Skip to content

Commit 0b89c61

Browse files
committed
added testMonitor.exe
1 parent 4e3bc49 commit 0b89c61

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ O2_GENERATE_EXECUTABLE(
168168
BUCKET_NAME ${BUCKET_NAME}
169169
)
170170

171+
O2_GENERATE_EXECUTABLE(
172+
EXE_NAME testMonitor.exe
173+
SOURCES src/testMonitor.cxx
174+
BUCKET_NAME ${BUCKET_NAME}
175+
)
176+
171177
# Install some extra files
172178
install(
173179
FILES readout.cfg

src/testMonitor.cxx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// simple test program used to evaluate overhead of monitoring lib
2+
3+
#include <stdint.h>
4+
#include <stdio.h>
5+
6+
#include <Monitoring/MonitoringFactory.h>
7+
using namespace o2::monitoring;
8+
9+
int main() {
10+
11+
std::unique_ptr<Monitoring> monitoringCollector;
12+
monitoringCollector=MonitoringFactory::Get("influxdb-udp://aido2mon-gpn.cern.ch:8088");
13+
monitoringCollector->enableProcessMonitoring(1);
14+
15+
uint64_t bytesTotal=0;
16+
17+
for(;;){
18+
bytesTotal+=1000000000;
19+
monitoringCollector->send({bytesTotal, "readout.BytesTotal"});
20+
monitoringCollector->send({bytesTotal, "readout.BytesTotal"}, DerivedMetricMode::RATE);
21+
printf(".");
22+
fflush(stdout);
23+
sleep(1);
24+
}
25+
26+
return 0;
27+
}

0 commit comments

Comments
 (0)