| 52 | } |
| 53 | |
| 54 | void GelfWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata) |
| 55 | { |
| 56 | DictionaryData nodes; |
| 57 | |
| 58 | for (const GelfWriter::Ptr& gelfwriter : ConfigType::GetObjectsByType<GelfWriter>()) { |
| 59 | size_t workQueueItems = gelfwriter->m_WorkQueue.GetLength(); |
| 60 | double workQueueItemRate = gelfwriter->m_WorkQueue.GetTaskCount(60) / 60.0; |
| 61 | |
| 62 | nodes.emplace_back(gelfwriter->GetName(), new Dictionary({ |
| 63 | { "work_queue_items", workQueueItems }, |
| 64 | { "work_queue_item_rate", workQueueItemRate }, |
| 65 | { "connected", gelfwriter->GetConnected() }, |
| 66 | { "source", gelfwriter->GetSource() } |
| 67 | })); |
| 68 | |
| 69 | perfdata->Add(new PerfdataValue("gelfwriter_" + gelfwriter->GetName() + "_work_queue_items", workQueueItems)); |
| 70 | perfdata->Add(new PerfdataValue("gelfwriter_" + gelfwriter->GetName() + "_work_queue_item_rate", workQueueItemRate)); |
| 71 | } |
| 72 | |
| 73 | status->Set("gelfwriter", new Dictionary(std::move(nodes))); |
| 74 | } |
| 75 | |
| 76 | void GelfWriter::Resume() |
| 77 | { |
nothing calls this directly
no test coverage detected