Flecs v3.2
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
metrics.h
Go to the documentation of this file.
1
9#ifdef FLECS_METRICS
10
19#ifndef FLECS_METRICS_H
20#define FLECS_METRICS_H
21
22#ifndef FLECS_META
23#define FLECS_META
24#endif
25
26#ifndef FLECS_UNITS
27#define FLECS_UNITS
28#endif
29
30#ifndef FLECS_PIPELINE
31#define FLECS_PIPELINE
32#endif
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38FLECS_API extern ECS_COMPONENT_DECLARE(FlecsMetrics);
39
41FLECS_API extern ECS_TAG_DECLARE(EcsMetric);
42
44FLECS_API extern ECS_TAG_DECLARE(EcsCounter);
45
47FLECS_API extern ECS_TAG_DECLARE(EcsCounterIncrement);
48
50FLECS_API extern ECS_TAG_DECLARE(EcsCounterId);
51
53FLECS_API extern ECS_TAG_DECLARE(EcsGauge);
54
56FLECS_API extern ECS_TAG_DECLARE(EcsMetricInstance);
57
60
63
64typedef struct EcsMetricValue {
65 double value;
67
68typedef struct EcsMetricSource {
69 ecs_entity_t entity;
71
72typedef struct ecs_metric_desc_t {
73 int32_t _canary;
74
77
81
85
90 bool targets;
91
94
96 const char *brief;
98
138FLECS_API
140 ecs_world_t *world,
141 const ecs_metric_desc_t *desc);
142
151#define ecs_metric(world, ...)\
152 ecs_metric_init(world, &(ecs_metric_desc_t) __VA_ARGS__ )
153
154/* Module import */
155FLECS_API
156void FlecsMetricsImport(
157 ecs_world_t *world);
158
159#ifdef __cplusplus
160}
161#endif
162
163#endif
164
167#endif
FLECS_API ecs_entity_t ecs_metric_init(ecs_world_t *world, const ecs_metric_desc_t *desc)
Create a new metric.
ecs_id_t ecs_entity_t
An entity identifier.
Definition flecs.h:286
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
Definition flecs.h:330
uint64_t ecs_id_t
Ids are the things that can be added to an entity.
Definition flecs.h:279
#define ECS_TAG_DECLARE
Forward declare a tag.
Definition flecs_c.h:59
#define ECS_COMPONENT_DECLARE(id)
Forward declare a component.
Definition flecs_c.h:93
const char * brief
Description of metric.
Definition metrics.h:96
ecs_entity_t member
Entity associated with member that stores metric value.
Definition metrics.h:80
ecs_entity_t kind
Must be EcsGauge, EcsCounter, EcsCounterIncrement or EcsCounterId.
Definition metrics.h:93
ecs_entity_t entity
Entity associated with metric.
Definition metrics.h:76
bool targets
If id is a (R, *) wildcard and relationship R has the OneOf property, setting this value to true will...
Definition metrics.h:90
ecs_id_t id
Tracks whether entities have the specified component id.
Definition metrics.h:84