Skip to content

Commit 6d31986

Browse files
committed
send process monitor metrics in singe udp packet
1 parent b263911 commit 6d31986

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/Monitoring.cxx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ void Monitoring::flushBuffer() {
5454
MonLogger::Get() << "Cannot flush as buffering is disabled" << MonLogger::End();
5555
return;
5656
}
57-
auto capacity = mStorage.capacity();
58-
auto size = mStorage.size();
5957
send(std::move(mStorage));
6058
mStorage.clear();
6159
}
@@ -117,15 +115,8 @@ void Monitoring::processMonitorLoop(int interval)
117115
while (mMonitorRunning) {
118116
std::this_thread::sleep_for (std::chrono::milliseconds(interval*10));
119117
if ((++loopCount % 100) != 0) continue;
120-
/// TODO!!! send all the merics as a single measurement
121-
// send pmem, pcpu, etime
122-
for (auto&& metric : mProcessMonitor->getPidStatus()) {
123-
send(std::move(metric));
124-
}
125-
// send bytesReceived and bytedTransmitted per interface
126-
for (auto&& metric : mProcessMonitor->getNetworkUsage()) {
127-
send(std::move(metric));
128-
}
118+
send(mProcessMonitor->getPidStatus());
119+
send(mProcessMonitor->getNetworkUsage());
129120
loopCount = 0;
130121
}
131122
}

0 commit comments

Comments
 (0)