Flecs: Metrics
Description: A fast entity component system (ECS) for C & C++

| Flecs v4.0 A fast entity component system (ECS) for C & C++

Loading...
Searching...
No Matches
Metrics
C++ API » Addons

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_component & | flecs::untyped_component::metric (flecs::entity_t parent=0, const char *brief=nullptr, const char *name=nullptr)
| Register member as metric.
template<typename Kind>
untyped_component & | flecs::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() [1/3]

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

  Kind | Metric kind (Counter, CounterIncrement or Gauge).

Parameters

  parent | Parent entity of the metric (optional).
  brief | Description for metric (optional).
  name | Name of metric (optional).

## ◆ metric() [2/3]

template<typename Kind>

untyped_component & flecs::untyped_component::metric | ( | flecs::entity_t | parent = 0,
|  | const char * | brief = nullptr,
|  | const char * | name = nullptr )
| inline

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

  Kind | Metric kind (Counter, CounterIncrement or Gauge).

Parameters

  parent | Parent entity of the metric (optional).
  brief | Description for metric (optional).
  name | Name of metric (optional).

Definition at line 89 of file impl.hpp.

## ◆ metric() [3/3]

template<typename... Args>

flecs::metric_builder flecs::world::metric | ( | Args &&... | args | ) | const
| inline

Create metric.

Definition at line 83 of file impl.hpp.