1515
1616
1717#include < Monitoring/MonitoringFactory.h>
18- using namespace AliceO2 ::Monitoring ;
18+ using namespace o2 ::monitoring ;
1919
2020
2121// macro to get number of element in static array
@@ -57,7 +57,7 @@ class ConsumerStats: public Consumer {
5757
5858 int monitoringEnabled;
5959 int monitoringUpdatePeriod;
60- std::unique_ptr<Collector > monitoringCollector;
60+ std::unique_ptr<Monitoring > monitoringCollector;
6161
6262 struct rusage previousUsage; // variable to keep track of last getrusage() result
6363 struct rusage currentUsage; // variable to keep track of last getrusage() result
@@ -76,7 +76,7 @@ class ConsumerStats: public Consumer {
7676 + currentUsage.ru_stime .tv_sec *1000000.0 +currentUsage.ru_stime .tv_usec -(previousUsage.ru_stime .tv_sec *1000000.0 +previousUsage.ru_stime .tv_usec )
7777 ) / tDiff;
7878 if (monitoringEnabled) {
79- monitoringCollector->send (fractionCpuUsed*100 , " readout.percentCpuUsed" );
79+ monitoringCollector->send ({ fractionCpuUsed*100 , " readout.percentCpuUsed" } );
8080 // theLog.log("CPU used = %.2f %%",100*fractionCpuUsed);
8181 }
8282 }
@@ -88,10 +88,10 @@ class ConsumerStats: public Consumer {
8888 // todo: support for long long types
8989 // https://alice.its.cern.ch/jira/browse/FLPPROT-69
9090
91- monitoringCollector->send (counterBlocks, " readout.Blocks" );
92- monitoringCollector->send (counterBytesTotal, " readout.BytesTotal" );
93- monitoringCollector->send (counterBytesDiff, " readout.BytesInterval" );
94- // monitoringCollector->send((counterBytesTotal/(1024*1024)), "readout.MegaBytesTotal");
91+ monitoringCollector->send ({ counterBlocks, " readout.Blocks" } );
92+ monitoringCollector->send ({ counterBytesTotal, " readout.BytesTotal" }, DerivedMetricMode::RATE );
93+ monitoringCollector->send ({ counterBytesDiff, " readout.BytesInterval" } );
94+ // monitoringCollector->send({ (counterBytesTotal/(1024*1024)), "readout.MegaBytesTotal"} );
9595
9696 counterBytesDiff=0 ;
9797 }
@@ -108,7 +108,6 @@ class ConsumerStats: public Consumer {
108108 theLog.log (" Monitoring enabled - period %ds - using %s" ,monitoringUpdatePeriod,configURI.c_str ());
109109
110110 monitoringCollector=MonitoringFactory::Get (configURI.c_str ());
111- monitoringCollector->addDerivedMetric (" readout.BytesTotal" , DerivedMetricMode::RATE);
112111
113112 // enable process monitoring
114113 int processMonitoringInterval=0 ;
0 commit comments