mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-16 01:51:45 +00:00
Allow to limit number of messages for the Benchmark sampler and sink
This commit is contained in:
committed by
Florian Uhlig
parent
c10a6abeef
commit
0e1a1ad552
@@ -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");
|
||||
|
@@ -40,6 +40,14 @@ int main(int argc, char** argv)
|
||||
|
||||
try
|
||||
{
|
||||
int numMsgs;
|
||||
|
||||
options_description sink_options("Sink options");
|
||||
sink_options.add_options()
|
||||
("num-msgs", value<int>(&numMsgs)->default_value(0), "Number of messages to receive");
|
||||
|
||||
config.AddToCmdLineOptions(sink_options);
|
||||
|
||||
if (config.ParseAll(argc, argv))
|
||||
{
|
||||
return 0;
|
||||
@@ -64,6 +72,7 @@ int main(int argc, char** argv)
|
||||
sink.SetTransport(transportFactory);
|
||||
|
||||
sink.SetProperty(FairMQSink::Id, id);
|
||||
sink.SetProperty(FairMQSink::NumMsgs, numMsgs);
|
||||
sink.SetProperty(FairMQSink::NumIoThreads, config.GetValue<int>("io-threads"));
|
||||
|
||||
sink.ChangeState("INIT_DEVICE");
|
||||
|
@@ -1,18 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
if(@NANOMSG_FOUND@); then
|
||||
buffSize="500000000" # nanomsg buffer size is in bytes
|
||||
else
|
||||
buffSize="10000" # zeromq high-water mark is in messages
|
||||
fi
|
||||
|
||||
SAMPLER="bsampler"
|
||||
SAMPLER+=" --id bsampler1"
|
||||
SAMPLER+=" --event-size 10000"
|
||||
SAMPLER+=" --msg-size 1000000"
|
||||
#SAMPLER+=" --num-msgs 1000"
|
||||
SAMPLER+=" --config-json-file @CMAKE_BINARY_DIR@/bin/config/benchmark.json"
|
||||
xterm -geometry 80x23+0+0 -hold -e @CMAKE_BINARY_DIR@/bin/$SAMPLER &
|
||||
|
||||
SINK="sink"
|
||||
SINK+=" --id sink1"
|
||||
#SINK+=" --num-msgs 1000"
|
||||
SINK+=" --config-json-file @CMAKE_BINARY_DIR@/bin/config/benchmark.json"
|
||||
xterm -geometry 80x23+500+0 -hold -e @CMAKE_BINARY_DIR@/bin/$SINK &
|
||||
|
Reference in New Issue
Block a user