mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-16 10:01:47 +00:00
Allow rate limiting in the Shared Memory example
This commit is contained in:
@@ -29,11 +29,13 @@ int main(int argc, char** argv)
|
||||
{
|
||||
int msgSize;
|
||||
int numMsgs;
|
||||
int msgRate;
|
||||
|
||||
options_description samplerOptions("Sampler options");
|
||||
samplerOptions.add_options()
|
||||
("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");
|
||||
("num-msgs", value<int>(&numMsgs)->default_value(0), "Number of messages to send")
|
||||
("msg-rate", value<int>(&msgRate)->default_value(0), "Msg rate limit in maximum number of messages per second");
|
||||
|
||||
FairMQProgOptions config;
|
||||
config.AddToCmdLineOptions(samplerOptions);
|
||||
@@ -42,6 +44,7 @@ int main(int argc, char** argv)
|
||||
FairMQBenchmarkSampler sampler;
|
||||
sampler.SetProperty(FairMQBenchmarkSampler::MsgSize, msgSize);
|
||||
sampler.SetProperty(FairMQBenchmarkSampler::NumMsgs, numMsgs);
|
||||
sampler.SetProperty(FairMQBenchmarkSampler::MsgRate, msgRate);
|
||||
|
||||
runStateMachine(sampler, config);
|
||||
}
|
||||
|
@@ -28,6 +28,7 @@ SAMPLER+=" --id bsampler1"
|
||||
#SAMPLER+=" --control static"
|
||||
#SAMPLER+=" --transport nanomsg"
|
||||
SAMPLER+=" --msg-size $msgSize"
|
||||
# SAMPLER+=" --msg-rate 1000"
|
||||
SAMPLER+=" --num-msgs $numMsgs"
|
||||
SAMPLER+=" --mq-config @CMAKE_BINARY_DIR@/bin/config/benchmark.json"
|
||||
xterm -geometry 80x23+0+0 -hold -e @CMAKE_BINARY_DIR@/bin/$SAMPLER &
|
||||
|
Reference in New Issue
Block a user