* 'perfdata' must be a flat dictionary with double values * 'status' dictionary can contain multiple levels of dictionaries */
| 260 | * 'status' dictionary can contain multiple levels of dictionaries |
| 261 | */ |
| 262 | std::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 | |
| 279 | REGISTER_STATSFUNCTION(CIB, &CIB::StatsFunc); |
| 280 |