chronon::observe::DerivedCounter
Computed counter declared as a unit member alongside raw Counters. More...
#include <DerivedCounter.hpp>
Public Functions
| Name | |
|---|---|
| DerivedCounter & | operator=(const DerivedCounter & ) =delete |
| const std::string & | name() const |
| const std::string & | description() const |
| DerivedCounter(ObservableUnit * owner, std::string_view name, std::string_view description, std::initializer_list< std::reference_wrapper< const Counter > > sources, ComputeFn compute) | |
| DerivedCounter(const DerivedCounter & ) =delete |
Friends
| Name | |
|---|---|
| class | ObservableUnit |
Detailed Description
class chronon::observe::DerivedCounter;
Computed counter declared as a unit member alongside raw Counters.
Computation runs on the backend thread at CSV dump time, so there is no simulation hot-path overhead.
class Fetch : public TickableUnit, public ObservableUnit {
Counter hits_{this, "hits", "Cache hits"};
Counter misses_{this, "misses", "Cache misses"};
DerivedCounter hit_rate_{this, "hit_rate", "Cache hit rate",
{hits_, misses_}, DerivedFormula::Ratio};
};
Public Functions Documentation
function operator=
DerivedCounter & operator=(
const DerivedCounter &
) =delete
function name
inline const std::string & name() const
function description
inline const std::string & description() const
function DerivedCounter
DerivedCounter(
ObservableUnit * owner,
std::string_view name,
std::string_view description,
std::initializer_list< std::reference_wrapper< const Counter > > sources,
ComputeFn compute
)
Parameters:
- owner Owning ObservableUnit.
- name Derived counter name (appears as unit.name in CSV).
- description Human-readable description.
- sources Source counters whose delta values are passed to
compute. - compute Function computing the derived value from source deltas.
function DerivedCounter
DerivedCounter(
const DerivedCounter &
) =delete
Friends
friend ObservableUnit
friend class ObservableUnit(
ObservableUnit
);
Updated on 2026-05-26 at 05:42:33 +0000