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

Method GetFeatureStats

lib/icinga/cib.cpp:262–277  ·  view source on GitHub ↗

* 'perfdata' must be a flat dictionary with double values * 'status' dictionary can contain multiple levels of dictionaries */

Source from the content-addressed store, hash-verified

260 * 'status' dictionary can contain multiple levels of dictionaries
261 */
262std::pair<Dictionary::Ptr, Array::Ptr> CIB::GetFeatureStats()
263{
264 Dictionary::Ptr status = new Dictionary();
265 Array::Ptr perfdata = new Array();
266
267 Namespace::Ptr statsFunctions = ScriptGlobal::Get("StatsFunctions", &Empty);
268
269 if (statsFunctions) {
270 ObjectLock olock(statsFunctions);
271
272 for (const Namespace::Pair& kv : statsFunctions)
273 static_cast<Function::Ptr>(kv.second.Val)->Invoke({ status, perfdata });
274 }
275
276 return std::make_pair(status, perfdata);
277}
278
279REGISTER_STATSFUNCTION(CIB, &CIB::StatsFunc);
280

Callers

nothing calls this directly

Calls 1

InvokeMethod · 0.45

Tested by

no test coverage detected