@@ -26,6 +26,7 @@ int main(int argc, char *argv[]) {
2626 (" id" , boost::program_options::value<std::string>(), " Instance ID" )
2727 (" count" , boost::program_options::value<int >(), " Number of metric bunches (x3)" )
2828 (" multiple" , boost::program_options::bool_switch ()->default_value (false ), " Sends multiple metrics per measurement" )
29+ (" vector" , boost::program_options::bool_switch ()->default_value (false ), " Sends vector of metrics" )
2930 ;
3031
3132 boost::program_options::variables_map vm;
@@ -48,22 +49,31 @@ int main(int argc, char *argv[]) {
4849 add = 1 ;
4950 }
5051
51- if (! vm[" multiple" ].as <bool >()) {
52+ if (vm[" multiple" ].as <bool >()) {
5253 for (int i = 0 ; i <= count; i += add) {
53- monitoring->send ({" string" + std::to_string (intDist (mt)), " stringMetric" });
54- monitoring->send ({doubleDist (mt), " doubleMetric" });
55- monitoring->send ({intDist (mt), " intMetric" });
56- monitoring->debug ({intDist (mt), " intMetricDebug" });
54+ monitoring->sendGrouped (" benchmarkMeasurement" ,{
55+ {" string" + std::to_string (intDist (mt)), " stringMetric" },
56+ {doubleDist (mt), " doubleMetric" },
57+ {intDist (mt), " intMetric" }
58+ });
5759 std::this_thread::sleep_for (std::chrono::microseconds (sleep));
5860 }
59- } else {
61+ } else if (vm[ " vector " ]. as < bool >()) {
6062 for (int i = 0 ; i <= count; i += add) {
61- monitoring->sendGrouped ( " benchmarkMeasurement " , {
63+ monitoring->send ( {
6264 {" string" + std::to_string (intDist (mt)), " stringMetric" },
6365 {doubleDist (mt), " doubleMetric" },
64- {intDist (mt), " intMetric " }
66+ {intDist (mt), " intMetricDebug " }
6567 });
6668 std::this_thread::sleep_for (std::chrono::microseconds (sleep));
6769 }
70+ } else {
71+ for (int i = 0 ; i <= count; i += add) {
72+ monitoring->send ({" string" + std::to_string (intDist (mt)), " stringMetric" });
73+ monitoring->send ({doubleDist (mt), " doubleMetric" });
74+ monitoring->send ({intDist (mt), " intMetric" });
75+ monitoring->debug ({intDist (mt), " intMetricDebug" });
76+ std::this_thread::sleep_for (std::chrono::microseconds (sleep));
77+ }
6878 }
6979}
0 commit comments