Lumiera
0.pre.03
»edit your freedom«
|
Go to the source code of this file.
Record and evaluate concurrent activations.
This observation and instrumentation helper is typically used to capture density of incidence and effective concurrency of performance critical tasks. The overhead per measurement call amounts to one SystemClock invocation plus some heap memory access, assuming that sufficient memory was pre-allocated prior to the actual observation phase. Moreover, on first invocation per Thread, a thread local ID is constructed, thereby incrementing an global atomic counter. Statistics evaluation is comprised of integrating and sorting the captured event log, followed by a summation pass.
This helper is intended for tests and one-time usage. Create an instance, launch a test, retrieve the observed statistics, destroy the object. Each separate Threads encountered gets the next consecutive ID. Thus it is not possible to have long-living instances or even multiple instances of IncidenceCount; doing so would require a much more elaborate ID management, which is beyond requirement's scope.
Definition in file incidence-count.hpp.
#include "lib/nocopy.hpp"
#include "lib/iter-explorer.hpp"
#include <cstdint>
#include <atomic>
#include <vector>
#include <chrono>
#include <limits>
#include <algorithm>
Classes | |
struct | IncidenceCount::Inc |
class | IncidenceCount |
A recorder for concurrent incidences. More... | |
struct | IncidenceCount::Statistic |
Namespaces | |
lib | |
Implementation namespace for support and library code. | |