Flecs v4.0
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
Metrics

The metrics module extracts metrics from components and makes them available through a unified component interface. More...

Collaboration diagram for Metrics:

Classes

struct  flecs::metric_builder
 Event builder interface. More...
 
struct  flecs::metrics
 

Functions

template<typename... Args>
flecs::metric_builder flecs::world::metric (Args &&... args) const
 Create metric.
 
template<typename Kind >
untyped_componentflecs::component< T >::metric (flecs::entity_t parent=0, const char *brief=nullptr, const char *name=nullptr)
 Register member as metric.
 

Detailed Description

The metrics module extracts metrics from components and makes them available through a unified component interface.

Function Documentation

◆ metric()

template<typename Kind >
untyped_component & metric ( flecs::entity_t parent = 0,
const char * brief = nullptr,
const char * name = nullptr )

Register member as metric.

When no explicit name is provided, this operation will derive the metric name from the member name. When the member name is "value", the operation will use the name of the component.

When the brief parameter is provided, it is set on the metric as if set_doc_brief is used. The brief description can be obtained with get_doc_brief.

Template Parameters
KindMetric kind (Counter, CounterIncrement or Gauge).
Parameters
parentParent entity of the metric (optional).
briefDescription for metric (optional).
nameName of metric (optional).