* Feature stats interface * * @param status Key value pairs for feature stats * @param perfdata Array of PerfdataValue objects */
| 55 | * @param perfdata Array of PerfdataValue objects |
| 56 | */ |
| 57 | void GraphiteWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata) |
| 58 | { |
| 59 | DictionaryData nodes; |
| 60 | |
| 61 | for (const GraphiteWriter::Ptr& graphitewriter : ConfigType::GetObjectsByType<GraphiteWriter>()) { |
| 62 | size_t workQueueItems = graphitewriter->m_WorkQueue.GetLength(); |
| 63 | double workQueueItemRate = graphitewriter->m_WorkQueue.GetTaskCount(60) / 60.0; |
| 64 | |
| 65 | nodes.emplace_back(graphitewriter->GetName(), new Dictionary({ |
| 66 | { "work_queue_items", workQueueItems }, |
| 67 | { "work_queue_item_rate", workQueueItemRate }, |
| 68 | { "connected", graphitewriter->GetConnected() } |
| 69 | })); |
| 70 | |
| 71 | perfdata->Add(new PerfdataValue("graphitewriter_" + graphitewriter->GetName() + "_work_queue_items", workQueueItems)); |
| 72 | perfdata->Add(new PerfdataValue("graphitewriter_" + graphitewriter->GetName() + "_work_queue_item_rate", workQueueItemRate)); |
| 73 | } |
| 74 | |
| 75 | status->Set("graphitewriter", new Dictionary(std::move(nodes))); |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * Resume is equivalent to Start, but with HA capabilities to resume at runtime. |
nothing calls this directly
no test coverage detected