Flecs v4.0
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
stats.h
Go to the documentation of this file.
1
15#ifdef FLECS_STATS
16
25#ifndef FLECS_STATS_H
26#define FLECS_STATS_H
27
28#ifndef FLECS_MODULE
29#define FLECS_MODULE
30#endif
31
32#ifndef FLECS_PIPELINE
33#define FLECS_PIPELINE
34#endif
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40#define ECS_STAT_WINDOW (60)
41
43typedef struct ecs_gauge_t {
44 ecs_float_t avg[ECS_STAT_WINDOW];
45 ecs_float_t min[ECS_STAT_WINDOW];
46 ecs_float_t max[ECS_STAT_WINDOW];
48
50typedef struct ecs_counter_t {
52 double value[ECS_STAT_WINDOW];
54
56typedef union ecs_metric_t {
57 ecs_gauge_t gauge;
58 ecs_counter_t counter;
60
61typedef struct ecs_world_stats_t {
62 int64_t first_;
63
64 /* Entities */
65 struct {
68 } entities;
69
70 /* Component ids */
71 struct {
78 } components;
79
80 /* Tables */
81 struct {
86 } tables;
87
88 /* Queries & events */
89 struct {
93 } queries;
94
95 /* Commands */
96 struct {
97 ecs_metric_t add_count;
98 ecs_metric_t remove_count;
100 ecs_metric_t clear_count;
101 ecs_metric_t set_count;
102 ecs_metric_t ensure_count;
103 ecs_metric_t modified_count;
104 ecs_metric_t other_count;
105 ecs_metric_t discard_count;
106 ecs_metric_t batched_entity_count;
107 ecs_metric_t batched_count;
108 } commands;
109
110 /* Frame data */
111 struct {
119 } frame;
120
121 /* Timing */
122 struct {
132 } performance;
133
134 struct {
135 /* Memory allocation data */
141 /* Memory allocator data */
148 } memory;
149
150 /* HTTP statistics */
151 struct {
152 ecs_metric_t request_received_count;
153 ecs_metric_t request_invalid_count;
154 ecs_metric_t request_handled_ok_count;
155 ecs_metric_t request_handled_error_count;
156 ecs_metric_t request_not_handled_count;
157 ecs_metric_t request_preflight_count;
158 ecs_metric_t send_ok_count;
159 ecs_metric_t send_error_count;
160 ecs_metric_t busy_count;
161 } http;
162
163 int64_t last_;
164
166 int32_t t;
168
180
182typedef struct ecs_system_stats_t {
183 int64_t first_;
185 int64_t last_;
186
187 bool task;
189 ecs_query_stats_t query;
191
193typedef struct ecs_sync_stats_t {
194 int64_t first_;
195 ecs_metric_t time_spent;
196 ecs_metric_t commands_enqueued;
197 int64_t last_;
198
199 int32_t system_count;
200 bool multi_threaded;
201 bool immediate;
203
205typedef struct ecs_pipeline_stats_t {
206 /* Allow for initializing struct with {0} */
207 int8_t canary_;
208
211 ecs_vec_t systems;
212
214 ecs_vec_t sync_points;
215
217 int32_t t;
218
219 int32_t system_count;
223
229FLECS_API
231 const ecs_world_t *world,
232 ecs_world_stats_t *stats);
233
235FLECS_API
238 const ecs_world_stats_t *src);
239
241FLECS_API
243 ecs_world_stats_t *stats,
244 const ecs_world_stats_t *old,
245 int32_t count);
246
248FLECS_API
250 ecs_world_stats_t *stats);
251
253FLECS_API
256 const ecs_world_stats_t *src);
257
258FLECS_API
259void ecs_world_stats_log(
260 const ecs_world_t *world,
261 const ecs_world_stats_t *stats);
262
270FLECS_API
272 const ecs_world_t *world,
273 const ecs_query_t *query,
274 ecs_query_stats_t *stats);
275
277FLECS_API
280 const ecs_query_stats_t *src);
281
283FLECS_API
285 ecs_query_stats_t *stats,
286 const ecs_query_stats_t *old,
287 int32_t count);
288
290FLECS_API
292 ecs_query_stats_t *stats);
293
295FLECS_API
298 const ecs_query_stats_t *src);
299
308FLECS_API
310 const ecs_world_t *world,
311 ecs_entity_t system,
312 ecs_system_stats_t *stats);
313
315FLECS_API
318 const ecs_system_stats_t *src);
319
321FLECS_API
323 ecs_system_stats_t *stats,
324 const ecs_system_stats_t *old,
325 int32_t count);
326
328FLECS_API
330 ecs_system_stats_t *stats);
331
333FLECS_API
336 const ecs_system_stats_t *src);
337
346FLECS_API
348 ecs_world_t *world,
349 ecs_entity_t pipeline,
350 ecs_pipeline_stats_t *stats);
351
356FLECS_API
358 ecs_pipeline_stats_t *stats);
359
361FLECS_API
364 const ecs_pipeline_stats_t *src);
365
367FLECS_API
370 const ecs_pipeline_stats_t *old,
371 int32_t count);
372
374FLECS_API
376 ecs_pipeline_stats_t *stats);
377
385FLECS_API
388 const ecs_pipeline_stats_t *src);
389
391FLECS_API
393 ecs_metric_t *dst,
394 const ecs_metric_t *src,
395 int32_t t_dst,
396 int32_t t_src);
397
399FLECS_API
401 ecs_metric_t *m,
402 int32_t t,
403 int32_t count);
404
406FLECS_API
408 ecs_metric_t *m,
409 int32_t dst,
410 int32_t src);
411
412FLECS_API extern ECS_COMPONENT_DECLARE(FlecsStats);
418/* Memory statistics components */
429FLECS_API extern ecs_entity_t EcsPeriod1s;
430FLECS_API extern ecs_entity_t EcsPeriod1m;
431FLECS_API extern ecs_entity_t EcsPeriod1h;
432FLECS_API extern ecs_entity_t EcsPeriod1d;
433FLECS_API extern ecs_entity_t EcsPeriod1w;
436typedef struct {
437 ecs_ftime_t elapsed;
438 int32_t reduce_count;
440
442typedef struct {
443 EcsStatsHeader hdr;
444 ecs_world_stats_t *stats;
446
448typedef struct {
449 EcsStatsHeader hdr;
450 ecs_map_t stats;
452
454typedef struct {
455 EcsStatsHeader hdr;
456 ecs_map_t stats;
458
460typedef struct {
461 /* Time */
462 double target_fps;
463 double time_scale;
464 double fps;
466 /* Totals */
471 int64_t entity_count;
472 int64_t table_count;
473 int64_t frame_count;
475 int64_t merge_count;
477 int64_t systems_ran_total;
478 int64_t observers_ran_total;
479 int64_t queries_ran_total;
480
481 int32_t tag_count;
483 int32_t pair_count;
485 /* Per frame */
490 int64_t merge_count_frame;
491 int64_t systems_ran_frame;
492 int64_t observers_ran_frame;
493 int64_t queries_ran_frame;
497 uint32_t uptime;
499 /* Build info */
502
504typedef struct {
505 int32_t alive_count;
508 ecs_size_t bytes_names;
509 ecs_size_t bytes_doc_strings;
511
512/* Component memory. */
513typedef struct {
514 int32_t instances;
520
522typedef struct {
523 int32_t count;
525 ecs_size_t bytes_table_cache;
526 ecs_size_t bytes_name_index;
530
532typedef struct {
533 int32_t count;
534 int32_t cached_count;
535 ecs_size_t bytes_query;
536 ecs_size_t bytes_cache;
537 ecs_size_t bytes_group_by;
538 ecs_size_t bytes_order_by;
539 ecs_size_t bytes_plan;
540 ecs_size_t bytes_terms;
541 ecs_size_t bytes_misc;
543
545#define ECS_TABLE_MEMORY_HISTOGRAM_BUCKET_COUNT 14
546#define ECS_TABLE_MEMORY_HISTOGRAM_MAX_COUNT (1 << ECS_TABLE_MEMORY_HISTOGRAM_BUCKET_COUNT)
547
549typedef struct {
550 int32_t count;
551 int32_t empty_count;
552 int32_t column_count;
553 ecs_size_t bytes_table;
554 ecs_size_t bytes_type;
555 ecs_size_t bytes_entities;
556 ecs_size_t bytes_overrides;
557 ecs_size_t bytes_columns;
559 ecs_size_t bytes_column_map;
561 ecs_size_t bytes_dirty_state;
562 ecs_size_t bytes_edges;
564
566typedef struct {
567 int32_t entity_counts[ECS_TABLE_MEMORY_HISTOGRAM_BUCKET_COUNT];
569
571typedef struct {
572 ecs_size_t bytes_world;
573 ecs_size_t bytes_observers;
574 ecs_size_t bytes_systems;
575 ecs_size_t bytes_pipelines;
578 ecs_size_t bytes_type_info;
579 ecs_size_t bytes_commands;
582 ecs_size_t bytes_reflection;
583 ecs_size_t bytes_stats;
584 ecs_size_t bytes_rest;
586
589typedef struct {
590 ecs_size_t bytes_graph_edge;
592 ecs_size_t bytes_pair_record;
593 ecs_size_t bytes_table_diff;
595 ecs_size_t bytes_allocator;
598 ecs_size_t bytes_query_impl;
599 ecs_size_t bytes_query_cache;
600 ecs_size_t bytes_misc;
602
604typedef struct {
605 ecs_entities_memory_t entities;
606 ecs_component_memory_t components;
607 ecs_component_index_memory_t component_index;
608 ecs_query_memory_t queries;
609 ecs_table_memory_t tables;
610 ecs_table_histogram_t table_histogram;
612 ecs_allocator_memory_t allocators;
613 double collection_time;
615
622FLECS_API
624 const ecs_world_t *world);
625
632 const ecs_component_record_t *cr,
634
640FLECS_API
642 const ecs_world_t *world);
643
649FLECS_API
651 const ecs_query_t *query,
652 ecs_query_memory_t *result);
653
659FLECS_API
661 const ecs_world_t *world);
662
669 const ecs_table_t *table,
670 ecs_component_memory_t *result);
671
677FLECS_API
679 const ecs_world_t *world);
680
687 const ecs_table_t *table,
688 ecs_table_memory_t *result);
689
695FLECS_API
697 const ecs_world_t *world);
698
704FLECS_API
706 const ecs_world_t *world);
707
713FLECS_API
715 const ecs_world_t *world);
716
722FLECS_API
724 const ecs_world_t *world);
725
730FLECS_API
731ecs_size_t ecs_memory_get(
732 const ecs_world_t *world);
733
734
743FLECS_API
745 ecs_world_t *world);
746
747#ifdef __cplusplus
748}
749#endif
750
751#endif
752
755#endif
FLECS_API ecs_size_t ecs_memory_get(const ecs_world_t *world)
Get total memory used by world.
FLECS_API void ecs_world_stats_reduce(ecs_world_stats_t *dst, const ecs_world_stats_t *src)
Reduce source measurement window into single destination measurement.
union ecs_metric_t ecs_metric_t
Make all metrics the same size, so we can iterate over fields.
FLECS_API void ecs_query_stats_get(const ecs_world_t *world, const ecs_query_t *query, ecs_query_stats_t *stats)
Get query statistics.
FLECS_API void ecs_query_cache_stats_reduce_last(ecs_query_stats_t *stats, const ecs_query_stats_t *old, int32_t count)
Reduce last measurement into previous measurement, restore old value.
FLECS_API void ecs_world_stats_get(const ecs_world_t *world, ecs_world_stats_t *stats)
Get world statistics.
FLECS_API ecs_entity_t EcsPeriod1s
Tag used for metrics collected in last second.
FLECS_API ecs_query_memory_t ecs_queries_memory_get(const ecs_world_t *world)
Get memory usage statistics for queries.
struct ecs_pipeline_stats_t ecs_pipeline_stats_t
Statistics for all systems in a pipeline.
#define ECS_TABLE_MEMORY_HISTOGRAM_BUCKET_COUNT
Table memory histogram constants.
Definition stats.h:545
FLECS_API ecs_entity_t EcsPeriod1h
Tag used for metrics collected in last hour.
FLECS_API void ecs_pipeline_stats_reduce_last(ecs_pipeline_stats_t *stats, const ecs_pipeline_stats_t *old, int32_t count)
Reduce last measurement into previous measurement, restore old value.
FLECS_API ecs_component_memory_t ecs_component_memory_get(const ecs_world_t *world)
Get memory usage statistics for components.
FLECS_API ecs_misc_memory_t ecs_misc_memory_get(const ecs_world_t *world)
Get memory usage statistics for commands.
FLECS_API void ecs_query_cache_stats_repeat_last(ecs_query_stats_t *stats)
Repeat last measurement.
FLECS_API void ecs_metric_reduce_last(ecs_metric_t *m, int32_t t, int32_t count)
Reduce last measurement into previous measurement.
FLECS_API bool ecs_system_stats_get(const ecs_world_t *world, ecs_entity_t system, ecs_system_stats_t *stats)
Get system statistics.
FLECS_API void ecs_world_stats_reduce_last(ecs_world_stats_t *stats, const ecs_world_stats_t *old, int32_t count)
Reduce last measurement into previous measurement, restore old value.
FLECS_API ecs_allocator_memory_t ecs_allocator_memory_get(const ecs_world_t *world)
Get memory usage statistics for allocators.
FLECS_API ecs_table_histogram_t ecs_table_histogram_get(const ecs_world_t *world)
Get number of tables by number of entities in the table.
FLECS_API void ecs_query_cache_stats_reduce(ecs_query_stats_t *dst, const ecs_query_stats_t *src)
Reduce source measurement window into single destination measurement.
struct ecs_query_stats_t ecs_query_stats_t
Statistics for a single query (use ecs_query_cache_stats_get)
FLECS_API void ecs_query_memory_get(const ecs_query_t *query, ecs_query_memory_t *result)
Get memory usage statistics for single query.
FLECS_API void FlecsStatsImport(ecs_world_t *world)
Stats module import function.
FLECS_API void ecs_metric_copy(ecs_metric_t *m, int32_t dst, int32_t src)
Copy measurement.
FLECS_API ecs_entities_memory_t ecs_entity_memory_get(const ecs_world_t *world)
Memory statistics getters.
struct ecs_gauge_t ecs_gauge_t
Simple value that indicates current state.
FLECS_API void ecs_pipeline_stats_repeat_last(ecs_pipeline_stats_t *stats)
Repeat last measurement.
FLECS_API void ecs_pipeline_stats_fini(ecs_pipeline_stats_t *stats)
Free pipeline stats.
FLECS_API void ecs_pipeline_stats_copy_last(ecs_pipeline_stats_t *dst, const ecs_pipeline_stats_t *src)
Copy last measurement to destination.
FLECS_API void ecs_system_stats_reduce(ecs_system_stats_t *dst, const ecs_system_stats_t *src)
Reduce source measurement window into single destination measurement.
FLECS_API ecs_table_memory_t ecs_tables_memory_get(const ecs_world_t *world)
Get memory usage statistics for tables.
FLECS_API void ecs_pipeline_stats_reduce(ecs_pipeline_stats_t *dst, const ecs_pipeline_stats_t *src)
Reduce source measurement window into single destination measurement.
FLECS_API void ecs_system_stats_copy_last(ecs_system_stats_t *dst, const ecs_system_stats_t *src)
Copy last measurement from source to destination.
struct ecs_system_stats_t ecs_system_stats_t
Statistics for a single system (use ecs_system_stats_get())
FLECS_API void ecs_system_stats_repeat_last(ecs_system_stats_t *stats)
Repeat last measurement.
void ecs_table_component_memory_get(const ecs_table_t *table, ecs_component_memory_t *result)
Get component memory for table.
FLECS_API void ecs_world_stats_repeat_last(ecs_world_stats_t *stats)
Repeat last measurement.
struct ecs_sync_stats_t ecs_sync_stats_t
Statistics for sync point.
FLECS_API void ecs_world_stats_copy_last(ecs_world_stats_t *dst, const ecs_world_stats_t *src)
Copy last measurement from source to destination.
FLECS_API void ecs_metric_reduce(ecs_metric_t *dst, const ecs_metric_t *src, int32_t t_dst, int32_t t_src)
Reduce all measurements from a window into a single measurement.
FLECS_API ecs_entity_t EcsPeriod1m
Tag used for metrics collected in last minute.
FLECS_API bool ecs_pipeline_stats_get(ecs_world_t *world, ecs_entity_t pipeline, ecs_pipeline_stats_t *stats)
Get pipeline statistics.
FLECS_API ecs_entity_t EcsPeriod1w
Tag used for metrics collected in last week.
void ecs_component_record_memory_get(const ecs_component_record_t *cr, ecs_component_index_memory_t *result)
Get memory usage statistics for single component record.
struct ecs_counter_t ecs_counter_t
Monotonically increasing counter.
FLECS_API void ecs_system_stats_reduce_last(ecs_system_stats_t *stats, const ecs_system_stats_t *old, int32_t count)
Reduce last measurement into previous measurement, restore old value.
FLECS_API ecs_entity_t EcsPeriod1d
Tag used for metrics collected in last day.
void ecs_table_memory_get(const ecs_table_t *table, ecs_table_memory_t *result)
Get memory usage statistics for single table.
FLECS_API ecs_component_index_memory_t ecs_component_index_memory_get(const ecs_world_t *world)
Get memory usage statistics for the component index.
FLECS_API void ecs_query_cache_stats_copy_last(ecs_query_stats_t *dst, const ecs_query_stats_t *src)
Copy last measurement from source to destination.
struct ecs_component_record_t ecs_component_record_t
Information about a (component) id, such as type info and tables with the id.
Definition flecs.h:473
ecs_id_t ecs_entity_t
An entity identifier.
Definition flecs.h:361
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
Definition flecs.h:405
struct ecs_table_t ecs_table_t
A table stores entities and components for a specific type.
Definition flecs.h:411
#define ECS_COMPONENT_DECLARE(id)
Forward declare a component.
Definition flecs_c.h:112
#define ecs_ftime_t
Customizable precision for scalar time values.
Definition flecs.h:59
#define ecs_float_t
Customizable precision for floating point operations.
Definition flecs.h:52
Component that stores pipeline statistics.
Definition stats.h:454
Common data for statistics.
Definition stats.h:436
Component that stores system statistics.
Definition stats.h:448
Component with memory statistics.
Definition stats.h:604
Component that stores world statistics.
Definition stats.h:442
Component that stores a summary of world statistics.
Definition stats.h:460
int32_t component_count
Number of component (data) ids in the world.
Definition stats.h:482
double frame_time_frame
Time spent processing a frame.
Definition stats.h:486
double simulation_time
Time spent in simulation.
Definition stats.h:496
double target_fps
Target FPS.
Definition stats.h:462
double merge_time_total
Total time spent in merges.
Definition stats.h:469
double system_time_frame
Time spent in systems.
Definition stats.h:487
int64_t frame_count
Number of frames processed.
Definition stats.h:473
int32_t pair_count
Number of pair ids in the world.
Definition stats.h:483
ecs_build_info_t build_info
Build info.
Definition stats.h:500
int64_t merge_count
Number of merges executed.
Definition stats.h:475
int64_t command_count_frame
Number of commands processed in last frame.
Definition stats.h:494
double system_time_total
Total time spent in systems.
Definition stats.h:468
uint32_t uptime
Time since world was created.
Definition stats.h:497
double merge_time_frame
Time spent in merges.
Definition stats.h:488
double frame_time_total
Total time spent processing a frame.
Definition stats.h:467
int32_t tag_count
Number of tag (no data) ids in the world.
Definition stats.h:481
double time_scale
Simulation time scale.
Definition stats.h:463
double fps
FPS.
Definition stats.h:464
int64_t command_count
Number of commands processed.
Definition stats.h:474
Allocator memory.
Definition stats.h:589
ecs_size_t bytes_sparse_chunk
Table diff allocator.
Definition stats.h:594
ecs_size_t bytes_table_diff
Pair record allocator.
Definition stats.h:593
ecs_size_t bytes_query_impl
Command batching entry chunk allocator.
Definition stats.h:598
ecs_size_t bytes_allocator
Sparse chunk allocator.
Definition stats.h:595
ecs_size_t bytes_stack_allocator
Generic allocator.
Definition stats.h:596
ecs_size_t bytes_cmd_entry_chunk
Stack allocator.
Definition stats.h:597
ecs_size_t bytes_misc
Query cache struct allocator.
Definition stats.h:600
ecs_size_t bytes_pair_record
Component record allocator.
Definition stats.h:592
ecs_size_t bytes_query_cache
Query struct allocator.
Definition stats.h:599
ecs_size_t bytes_component_record
Graph edge allocator.
Definition stats.h:591
Type with information about the current Flecs build.
Definition flecs.h:1435
Component index memory.
Definition stats.h:522
ecs_size_t bytes_component_record
Number of component records.
Definition stats.h:524
ecs_size_t bytes_ordered_children
Bytes used by name index.
Definition stats.h:527
ecs_size_t bytes_table_cache
Bytes used by ecs_component_record_t struct.
Definition stats.h:525
ecs_size_t bytes_name_index
Bytes used by table cache.
Definition stats.h:526
ecs_size_t bytes_reachable_cache
Bytes used by ordered children vector.
Definition stats.h:528
ecs_size_t bytes_sparse_components
Bytes used in bitsets (toggled components).
Definition stats.h:518
ecs_size_t bytes_table_components_unused
Bytes used by table columns.
Definition stats.h:516
ecs_size_t bytes_table_components
Total number of component instances.
Definition stats.h:515
ecs_size_t bytes_toggle_bitsets
Unused bytes in table columns.
Definition stats.h:517
Monotonically increasing counter.
Definition stats.h:50
ecs_gauge_t rate
Keep track of deltas too.
Definition stats.h:51
Entity memory.
Definition stats.h:504
int32_t not_alive_count
Number of alive entities.
Definition stats.h:506
ecs_size_t bytes_doc_strings
Bytes used by names, symbols, aliases.
Definition stats.h:509
ecs_size_t bytes_entity_index
Number of not alive entities.
Definition stats.h:507
ecs_size_t bytes_names
Bytes used by entity index.
Definition stats.h:508
Simple value that indicates current state.
Definition stats.h:43
Misc memory.
Definition stats.h:571
ecs_size_t bytes_component_ids
Memory used by monitor used to track rematches.
Definition stats.h:581
ecs_size_t bytes_observers
Memory used by world and stages.
Definition stats.h:573
ecs_size_t bytes_type_info
Bytes used for component record lookup data structures.
Definition stats.h:578
ecs_size_t bytes_reflection
Memory used for mapping global to world-local component ids.
Definition stats.h:582
ecs_size_t bytes_stats
Memory used for component reflection not tracked elsewhere.
Definition stats.h:583
ecs_size_t bytes_systems
Memory used by observers.
Definition stats.h:574
ecs_size_t bytes_pipelines
Memory used by systems (excluding system queries).
Definition stats.h:575
ecs_size_t bytes_rematch_monitor
Command queue.
Definition stats.h:580
ecs_size_t bytes_rest
Memory used for statistics tracking not tracked elsewhere.
Definition stats.h:584
ecs_size_t bytes_commands
Bytes used for storing type information.
Definition stats.h:579
ecs_size_t bytes_component_record_lookup
Bytes used for table lookup data structures.
Definition stats.h:577
ecs_size_t bytes_table_lookup
Memory used by pipelines (excluding pipeline queries).
Definition stats.h:576
Statistics for all systems in a pipeline.
Definition stats.h:205
int32_t rebuild_count
Number of times pipeline has rebuilt.
Definition stats.h:221
int32_t system_count
Number of systems in pipeline.
Definition stats.h:219
ecs_vec_t systems
Vector with system ids of all systems in the pipeline.
Definition stats.h:211
int32_t active_system_count
Number of active systems in pipeline.
Definition stats.h:220
ecs_vec_t sync_points
Vector with sync point stats.
Definition stats.h:214
int32_t t
Current position in ring buffer.
Definition stats.h:217
Query memory.
Definition stats.h:532
ecs_size_t bytes_cache
Bytes used by ecs_query_impl_t struct.
Definition stats.h:536
ecs_size_t bytes_terms
Bytes used by query plan.
Definition stats.h:540
ecs_size_t bytes_order_by
Bytes used by query cache groups (excludes cache elements).
Definition stats.h:538
int32_t cached_count
Number of queries.
Definition stats.h:534
ecs_size_t bytes_query
Number of queries with caches.
Definition stats.h:535
ecs_size_t bytes_misc
Bytes used by terms array.
Definition stats.h:541
ecs_size_t bytes_group_by
Bytes used by query cache.
Definition stats.h:537
ecs_size_t bytes_plan
Bytes used by table_slices.
Definition stats.h:539
Statistics for a single query (use ecs_query_cache_stats_get)
Definition stats.h:170
ecs_metric_t result_count
Number of query results.
Definition stats.h:172
int32_t t
Current position in ringbuffer.
Definition stats.h:178
ecs_metric_t matched_table_count
Number of matched tables.
Definition stats.h:173
ecs_metric_t matched_entity_count
Number of matched entities.
Definition stats.h:174
Queries are lists of constraints (terms) that match entities.
Definition flecs.h:813
Statistics for sync point.
Definition stats.h:193
Statistics for a single system (use ecs_system_stats_get())
Definition stats.h:182
bool task
Is system a task.
Definition stats.h:187
ecs_metric_t time_spent
Time spent processing a system.
Definition stats.h:184
Table size histogram.
Definition stats.h:566
Table memory.
Definition stats.h:549
ecs_size_t bytes_dirty_state
Bytes used by component map.
Definition stats.h:561
ecs_size_t bytes_type
Bytes used by ecs_table_t struct.
Definition stats.h:554
ecs_size_t bytes_edges
Bytes used by dirty state.
Definition stats.h:562
ecs_size_t bytes_table
Number of table columns.
Definition stats.h:553
int32_t column_count
Number of empty tables.
Definition stats.h:552
ecs_size_t bytes_overrides
Bytes used by entity vectors.
Definition stats.h:556
ecs_size_t bytes_columns
Bytes used by table overrides.
Definition stats.h:557
ecs_size_t bytes_table_records
Bytes used by table columns (excluding component data).
Definition stats.h:558
ecs_size_t bytes_component_map
Bytes used by column map.
Definition stats.h:560
int32_t empty_count
Total number of tables.
Definition stats.h:551
ecs_size_t bytes_entities
Bytes used by type vector.
Definition stats.h:555
ecs_size_t bytes_column_map
Bytes used by table records.
Definition stats.h:559
ecs_metric_t alloc_count
Allocs per frame.
Definition stats.h:136
ecs_metric_t block_free_count
Block frees per frame.
Definition stats.h:143
ecs_metric_t system_time
Time spent on running systems.
Definition stats.h:126
ecs_metric_t world_time_raw
Actual time passed since simulation start (first time progress() is called)
Definition stats.h:123
ecs_metric_t delete_count
Number of times id has been deleted.
Definition stats.h:77
ecs_metric_t rematch_count
Number of query rematches.
Definition stats.h:114
ecs_metric_t frame_time
Time spent processing a frame.
Definition stats.h:125
ecs_metric_t tag_count
Number of tag ids (ids without data)
Definition stats.h:72
ecs_metric_t component_count
Number of components ids (ids with data)
Definition stats.h:73
ecs_metric_t system_count
Number of systems.
Definition stats.h:92
ecs_metric_t merge_count
Number of merges executed.
Definition stats.h:113
ecs_metric_t free_count
Frees per frame.
Definition stats.h:138
ecs_metric_t query_count
Number of queries.
Definition stats.h:90
ecs_metric_t world_time
Simulation time passed since simulation start.
Definition stats.h:124
ecs_metric_t realloc_count
Reallocs per frame.
Definition stats.h:137
ecs_metric_t merge_time
Time spent on merging commands.
Definition stats.h:128
ecs_metric_t outstanding_alloc_count
Difference between allocs & frees.
Definition stats.h:139
ecs_metric_t observers_ran
Number of times an observer was invoked.
Definition stats.h:117
ecs_metric_t frame_count
Number of frames processed.
Definition stats.h:112
ecs_metric_t event_emit_count
Number of events emitted.
Definition stats.h:118
ecs_metric_t empty_count
Number of empty tables.
Definition stats.h:83
ecs_metric_t block_outstanding_alloc_count
Difference between allocs & frees.
Definition stats.h:144
int32_t t
Current position in ring buffer.
Definition stats.h:166
ecs_metric_t stack_free_count
Page frees per frame.
Definition stats.h:146
ecs_metric_t rematch_time
Time spent on rematching.
Definition stats.h:129
ecs_metric_t fps
Frames per second.
Definition stats.h:130
ecs_metric_t systems_ran
Number of systems ran.
Definition stats.h:116
ecs_metric_t type_count
Number of registered types.
Definition stats.h:75
ecs_metric_t count
Number of entities.
Definition stats.h:66
ecs_metric_t emit_time
Time spent on notifying observers.
Definition stats.h:127
ecs_metric_t create_count
Number of times id has been created.
Definition stats.h:76
ecs_metric_t not_alive_count
Number of not alive (recyclable) entity ids.
Definition stats.h:67
ecs_metric_t stack_alloc_count
Page allocations per frame.
Definition stats.h:145
ecs_metric_t observer_count
Number of observers.
Definition stats.h:91
ecs_metric_t pipeline_build_count
Number of system pipeline rebuilds (occurs when an inactive system becomes active).
Definition stats.h:115
ecs_metric_t stack_outstanding_alloc_count
Difference between allocs & frees.
Definition stats.h:147
ecs_metric_t block_alloc_count
Block allocations per frame.
Definition stats.h:142
ecs_metric_t delta_time
Delta_time.
Definition stats.h:131
ecs_metric_t pair_count
Number of pair ids.
Definition stats.h:74
Make all metrics the same size, so we can iterate over fields.
Definition stats.h:56