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

Method Pause

lib/perfdata/influxdbcommonwriter.cpp:108–126  ·  view source on GitHub ↗

Pause is equivalent to Stop, but with HA capabilities to resume at runtime. */

Source from the content-addressed store, hash-verified

106
107/* Pause is equivalent to Stop, but with HA capabilities to resume at runtime. */
108void InfluxdbCommonWriter::Pause()
109{
110 m_HandleCheckResults.disconnect();
111
112 /* Force a flush. */
113 Log(LogDebug, GetReflectionType()->GetName())
114 << "Processing pending tasks and flushing data buffers.";
115
116 m_FlushTimer->Stop(true);
117 m_WorkQueue.Enqueue([this]() { FlushWQ(); }, PriorityLow);
118
119 /* Wait for the flush to complete, implicitly waits for all WQ tasks enqueued prior to pausing. */
120 m_WorkQueue.Join();
121
122 Log(LogInformation, GetReflectionType()->GetName())
123 << "'" << GetName() << "' paused.";
124
125 ObjectImpl<InfluxdbCommonWriter>::Pause();
126}
127
128void InfluxdbCommonWriter::AssertOnWorkQueue()
129{

Callers

nothing calls this directly

Calls 5

LogClass · 0.85
GetNameMethod · 0.45
StopMethod · 0.45
EnqueueMethod · 0.45
JoinMethod · 0.45

Tested by

no test coverage detected