diff --git a/examples/5-Benchmark.cxx b/examples/5-Benchmark.cxx index 1c5b4acaf..4d1bc2156 100644 --- a/examples/5-Benchmark.cxx +++ b/examples/5-Benchmark.cxx @@ -27,6 +27,8 @@ int main(int argc, char *argv[]) { ("count", boost::program_options::value(), "Number of metric bunches (x3)") ("multiple", boost::program_options::bool_switch()->default_value(false), "Sends multiple metrics per measurement") ("vector", boost::program_options::bool_switch()->default_value(false), "Sends vector of metrics") + ("monitor", boost::program_options::bool_switch()->default_value(false), "Enabled process monitor") + ("buffer", boost::program_options::value(), "Creates buffr of given size") ; boost::program_options::variables_map vm; @@ -42,7 +44,9 @@ int main(int argc, char *argv[]) { } auto monitoring = Monitoring::Get(vm["url"].as()); - monitoring->enableProcessMonitoring(1); + if (vm["monitor"].as()) { + monitoring->enableProcessMonitoring(1); + } int add = 0; if (count != 0) { count--; @@ -68,6 +72,9 @@ int main(int argc, char *argv[]) { std::this_thread::sleep_for(std::chrono::microseconds(sleep)); } } else { + if (vm.count("buffer")) { + monitoring->enableBuffering(vm["buffer"].as()); + } for (int i = 0; i <= count; i += add) { monitoring->send({"string" + std::to_string(intDist(mt)), "stringMetric"}); monitoring->send({doubleDist(mt), "doubleMetric"});