MCPcopy Create free account
hub / github.com/Icinga/icinga2 / AddBytesAndFlushIfNeeded

Method AddBytesAndFlushIfNeeded

lib/perfdata/otlpmetricswriter.cpp:265–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263}
264
265void OTLPMetricsWriter::AddBytesAndFlushIfNeeded(std::size_t newBytes)
266{
267 auto existingBytes = m_RecordedBytes.fetch_add(newBytes, std::memory_order_relaxed);
268 if (auto bytes{existingBytes + newBytes}; bytes >= static_cast<uint64_t>(GetFlushThreshold())) {
269 Log(LogDebug, "OTLPMetricsWriter")
270 << "Flush threshold reached, flushing '" << bytes << "' bytes of OTel metrics.";
271 Flush();
272 }
273}
274
275/**
276 * Record a data point for the specified OTel metric associated with the given configuration object.

Callers

nothing calls this directly

Calls 1

LogClass · 0.85

Tested by

no test coverage detected