mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
48 lines
1.3 KiB
C++
48 lines
1.3 KiB
C++
/********************************************************************************
|
|
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
|
* *
|
|
* This software is distributed under the terms of the *
|
|
* GNU Lesser General Public Licence (LGPL) version 3, *
|
|
* copied verbatim in the file "LICENSE" *
|
|
********************************************************************************/
|
|
/**
|
|
* FairMQBenchmarkSampler.h
|
|
*
|
|
* @since 2013-04-23
|
|
* @author D. Klein, A. Rybalchenko
|
|
*/
|
|
|
|
#ifndef FAIRMQBENCHMARKSAMPLER_H_
|
|
#define FAIRMQBENCHMARKSAMPLER_H_
|
|
|
|
#include <string>
|
|
#include <thread>
|
|
#include <atomic>
|
|
|
|
#include "FairMQDevice.h"
|
|
|
|
/**
|
|
* Sampler to generate traffic for benchmarking.
|
|
*/
|
|
|
|
class FairMQBenchmarkSampler : public FairMQDevice
|
|
{
|
|
public:
|
|
FairMQBenchmarkSampler();
|
|
virtual ~FairMQBenchmarkSampler();
|
|
|
|
protected:
|
|
bool fSameMessage;
|
|
int fMsgSize;
|
|
std::atomic<int> fMsgCounter;
|
|
float fMsgRate;
|
|
uint64_t fNumIterations;
|
|
uint64_t fMaxIterations;
|
|
std::string fOutChannelName;
|
|
|
|
virtual void InitTask() override;
|
|
virtual void Run() override;
|
|
};
|
|
|
|
#endif /* FAIRMQBENCHMARKSAMPLER_H_ */
|