Lumiera
0.pre.03
»edit your freedom«
|
#include "lib/incidence-count.hpp"
A recorder for concurrent incidences.
Start and end of individual activations are recorded by direct calls, automatically detecting the thread identity; for further differentiation, an additional caseID
can be given. Accumulated observations can be integrated into a statistics evaluation.
Definition at line 65 of file incidence-count.hpp.
Public Member Functions | |
double | calcCumulatedTime () |
Statistic | evaluate () |
Visit all data captured thus far, construct an unified timeline and then compute statistics evaluations to characterise observations. More... | |
IncidenceCount & | expectIncidents (size_t cnt) |
IncidenceCount & | expectThreads (uint8_t cnt) |
void | markEnter (uint8_t caseID=0) |
void | markLeave (uint8_t caseID=0) |
Classes | |
struct | Inc |
struct | Statistic |
Private Types | |
using | Clock = std::chrono::steady_clock |
using | Dur = std::chrono::duration< double, TIMING_SCALE > |
using | Instance = decltype(Clock::now()) |
using | Recording = vector< Sequence > |
using | Sequence = vector< Inc > |
using | TIMING_SCALE = std::micro |
Private Member Functions | |
void | addEntry (uint8_t caseID, bool isLeave) |
uint8_t | allocateNextSlot () |
threadsafe allocation of thread/slotID | |
Sequence & | getMySequence (uint8_t threadID) |
uint8_t | getMySlot () |
Private Member Functions inherited from NonCopyable | |
NonCopyable (NonCopyable const &)=delete | |
NonCopyable & | operator= (NonCopyable const &)=delete |
Private Attributes | |
Recording | rec_ |
std::atomic_uint8_t | slotID_ {0} |
struct lib::IncidenceCount::Inc |
|
inline |
Visit all data captured thus far, construct an unified timeline and then compute statistics evaluations to characterise observations.
Definition at line 207 of file incidence-count.hpp.
References IncidenceCount::Statistic::activeTime, IncidenceCount::Statistic::avgConcurrency, IncidenceCount::Statistic::caseCntr, IncidenceCount::Statistic::caseTime, IncidenceCount::Statistic::coveredTime, IncidenceCount::Statistic::cumulatedTime, lib::explore(), IncidenceCount::Statistic::thrdCntr, and IncidenceCount::Statistic::thrdTime.