Allow to limit number of messages for the Benchmark sampler and sink

This commit is contained in:
Alexey Rybalchenko
2016-01-07 17:37:43 +01:00
committed by Florian Uhlig
parent c10a6abeef
commit 0e1a1ad552
7 changed files with 161 additions and 69 deletions

View File

@@ -41,13 +41,13 @@ int main(int argc, char** argv)
try
{
int eventSize;
int eventRate;
int msgSize;
int numMsgs;
options_description sampler_options("Sampler options");
sampler_options.add_options()
("event-size", value<int>(&eventSize)->default_value(1000), "Event size in bytes")
("event-rate", value<int>(&eventRate)->default_value(0), "Event rate limit in maximum number of events per second");
("msg-size", value<int>(&msgSize)->default_value(1000), "Message size in bytes")
("num-msgs", value<int>(&numMsgs)->default_value(0), "Number of messages to send");
config.AddToCmdLineOptions(sampler_options);
@@ -72,8 +72,8 @@ int main(int argc, char** argv)
#endif
sampler.SetProperty(FairMQBenchmarkSampler::Id, id);
sampler.SetProperty(FairMQBenchmarkSampler::EventSize, eventSize);
sampler.SetProperty(FairMQBenchmarkSampler::EventRate, eventRate);
sampler.SetProperty(FairMQBenchmarkSampler::MsgSize, msgSize);
sampler.SetProperty(FairMQBenchmarkSampler::NumMsgs, numMsgs);
sampler.SetProperty(FairMQBenchmarkSampler::NumIoThreads, config.GetValue<int>("io-threads"));
sampler.ChangeState("INIT_DEVICE");