MCPcopy Create free account
hub / github.com/ComodoSecurity/openedr / getDataStatistic

Method getDataStatistic

edrav2/iprj/libcore/src/queue.cpp:386–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384//
385//
386Variant Queue::getDataStatistic(std::string sIndex)
387{
388 std::map<std::string, Size> stat;
389 Size nSkipped = 0;
390 {
391 std::scoped_lock sync(m_mtxData);
392 for (auto& v : m_data)
393 {
394 auto optData = variant::getByPathSafe(v, sIndex);
395 if (optData.has_value())
396 {
397 try
398 {
399 stat[variant::convert<variant::ValueType::String>(optData.value())]++;
400 }
401 catch (error::TypeError&)
402 {
403 nSkipped++;
404 }
405 }
406 else
407 nSkipped++;
408 }
409 }
410
411 Dictionary vItems;
412 for (auto&[name, val] : stat)
413 vItems.put(name, val);
414
415 Dictionary vData;
416 vData.put("items", vItems);
417 vData.put("skipped", nSkipped);
418
419 return vData;
420}
421
422//
423//

Callers

nothing calls this directly

Calls 4

getByPathSafeFunction · 0.85
has_valueMethod · 0.45
valueMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected