Flecs v4.1
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
41#define ECS_STAT_WINDOW (60)
42
49
55
61
63typedef struct ecs_world_stats_t {
64 int64_t first_;
66 /* Entities */
67 struct {
70 } entities;
71
72 /* Component IDs */
73 struct {
80 } components;
81
82 /* Tables */
83 struct {
88 } tables;
89
90 /* Queries and events */
91 struct {
95 } queries;
96
97 /* Commands */
98 struct {
110 } commands;
111
112 /* Frame data */
113 struct {
121 } frame;
122
123 /* Timing */
124 struct {
134 } performance;
135
136 struct {
137 /* Memory allocation data */
143 /* Memory allocator data */
150 } memory;
151
152 /* HTTP statistics */
153 struct {
163 } http;
164
165 int64_t last_;
168 int32_t t;
170
182
193
205
207typedef struct ecs_pipeline_stats_t {
208 int8_t canary_;
212 ecs_vec_t systems;
213
215 ecs_vec_t sync_points;
216
218 int32_t t;
219
220 int32_t system_count;
224
230FLECS_API
232 const ecs_world_t *world,
233 ecs_world_stats_t *stats);
234
236FLECS_API
239 const ecs_world_stats_t *src);
240
242FLECS_API
244 ecs_world_stats_t *stats,
245 const ecs_world_stats_t *old,
246 int32_t count);
247
249FLECS_API
251 ecs_world_stats_t *stats);
252
254FLECS_API
257 const ecs_world_stats_t *src);
258
264FLECS_API
266 const ecs_world_t *world,
267 const ecs_world_stats_t *stats);
268
276FLECS_API
278 const ecs_world_t *world,
279 const ecs_query_t *query,
280 ecs_query_stats_t *stats);
281
283FLECS_API
286 const ecs_query_stats_t *src);
287
289FLECS_API
291 ecs_query_stats_t *stats,
292 const ecs_query_stats_t *old,
293 int32_t count);
294
296FLECS_API
298 ecs_query_stats_t *stats);
299
301FLECS_API
304 const ecs_query_stats_t *src);
305
314FLECS_API
316 const ecs_world_t *world,
317 ecs_entity_t system,
318 ecs_system_stats_t *stats);
319
321FLECS_API
324 const ecs_system_stats_t *src);
325
327FLECS_API
329 ecs_system_stats_t *stats,
330 const ecs_system_stats_t *old,
331 int32_t count);
332
334FLECS_API
336 ecs_system_stats_t *stats);
337
339FLECS_API
342 const ecs_system_stats_t *src);
343
352FLECS_API
354 ecs_world_t *world,
355 ecs_entity_t pipeline,
356 ecs_pipeline_stats_t *stats);
357
362FLECS_API
364 ecs_pipeline_stats_t *stats);
365
367FLECS_API
370 const ecs_pipeline_stats_t *src);
371
373FLECS_API
376 const ecs_pipeline_stats_t *old,
377 int32_t count);
378
380FLECS_API
382 ecs_pipeline_stats_t *stats);
383
391FLECS_API
394 const ecs_pipeline_stats_t *src);
395
397FLECS_API
399 ecs_metric_t *dst,
400 const ecs_metric_t *src,
401 int32_t t_dst,
402 int32_t t_src);
403
405FLECS_API
407 ecs_metric_t *m,
408 int32_t t,
409 int32_t count);
410
412FLECS_API
414 ecs_metric_t *m,
415 int32_t dst,
416 int32_t src);
417
418FLECS_API extern ECS_COMPONENT_DECLARE(FlecsStats);
424/* Memory statistics components */
435FLECS_API extern ecs_entity_t EcsPeriod1s;
436FLECS_API extern ecs_entity_t EcsPeriod1m;
437FLECS_API extern ecs_entity_t EcsPeriod1h;
438FLECS_API extern ecs_entity_t EcsPeriod1d;
439FLECS_API extern ecs_entity_t EcsPeriod1w;
446
452
454typedef struct {
456 ecs_map_t stats;
458
460typedef struct {
462 ecs_map_t stats;
464
466typedef struct {
467 /* Time */
468 double target_fps;
469 double time_scale;
470 double fps;
472 /* Totals */
477 int64_t entity_count;
478 int64_t table_count;
479 int64_t frame_count;
481 int64_t merge_count;
487 int32_t tag_count;
489 int32_t pair_count;
491 /* Per frame */
503 uint32_t uptime;
505 /* Build info */
508
510typedef struct {
511 int32_t alive_count;
514 ecs_size_t bytes_names;
515 ecs_size_t bytes_doc_strings;
517
526
537
539typedef struct {
540 int32_t count;
541 int32_t cached_count;
542 ecs_size_t bytes_query;
543 ecs_size_t bytes_cache;
544 ecs_size_t bytes_group_by;
545 ecs_size_t bytes_order_by;
546 ecs_size_t bytes_plan;
547 ecs_size_t bytes_terms;
548 ecs_size_t bytes_misc;
550
552#define ECS_TABLE_MEMORY_HISTOGRAM_BUCKET_COUNT 14
553#define ECS_TABLE_MEMORY_HISTOGRAM_MAX_COUNT (1 << ECS_TABLE_MEMORY_HISTOGRAM_BUCKET_COUNT)
554
556typedef struct {
557 int32_t count;
558 int32_t empty_count;
559 int32_t column_count;
560 ecs_size_t bytes_table;
561 ecs_size_t bytes_type;
562 ecs_size_t bytes_entities;
563 ecs_size_t bytes_overrides;
564 ecs_size_t bytes_column_map;
566 ecs_size_t bytes_dirty_state;
567 ecs_size_t bytes_edges;
569
571typedef struct {
574
594
610
623
629FLECS_API
631 const ecs_world_t *world);
632
639 const ecs_component_record_t *cr,
641
647FLECS_API
649 const ecs_world_t *world);
650
656FLECS_API
658 const ecs_query_t *query,
659 ecs_query_memory_t *result);
660
666FLECS_API
668 const ecs_world_t *world);
669
676 const ecs_table_t *table,
677 ecs_component_memory_t *result);
678
684FLECS_API
686 const ecs_world_t *world);
687
694 const ecs_table_t *table,
695 ecs_table_memory_t *result);
696
702FLECS_API
704 const ecs_world_t *world);
705
711FLECS_API
713 const ecs_world_t *world);
714
720FLECS_API
722 const ecs_world_t *world);
723
729FLECS_API
731 const ecs_world_t *world);
732
738FLECS_API
739ecs_size_t ecs_memory_get(
740 const ecs_world_t *world);
741
742
751FLECS_API
753 ecs_world_t *world);
754
755#ifdef __cplusplus
756}
757#endif
758
759#endif
760
763#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.
#define ECS_STAT_WINDOW
Number of samples in the stat window.
Definition stats.h:41
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:552
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 miscellaneous allocations.
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.
struct ecs_world_stats_t ecs_world_stats_t
Type that contains world statistics.
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)
Get memory usage statistics for the entity index.
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 void ecs_world_stats_log(const ecs_world_t *world, const ecs_world_stats_t *stats)
Log world statistics.
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:497
ecs_id_t ecs_entity_t
An entity identifier.
Definition flecs.h:385
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
Definition flecs.h:429
struct ecs_table_t ecs_table_t
A table stores entities and components for a specific type.
Definition flecs.h:435
#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:460
EcsStatsHeader hdr
Statistics header.
Definition stats.h:461
ecs_map_t stats
Map of pipeline statistics.
Definition stats.h:462
Common header for statistics types.
Definition stats.h:442
int32_t reduce_count
Number of times statistics have been reduced.
Definition stats.h:444
ecs_ftime_t elapsed
Elapsed time since last reset.
Definition stats.h:443
Component that stores system statistics.
Definition stats.h:454
ecs_map_t stats
Map of system statistics.
Definition stats.h:456
EcsStatsHeader hdr
Statistics header.
Definition stats.h:455
Component with memory statistics.
Definition stats.h:612
ecs_entities_memory_t entities
Entity memory.
Definition stats.h:613
ecs_query_memory_t queries
Query memory.
Definition stats.h:616
ecs_table_memory_t tables
Table memory.
Definition stats.h:617
ecs_table_histogram_t table_histogram
Table size histogram.
Definition stats.h:618
ecs_misc_memory_t misc
Miscellaneous memory.
Definition stats.h:619
double collection_time
Time spent collecting statistics.
Definition stats.h:621
ecs_allocator_memory_t allocators
Allocator memory.
Definition stats.h:620
ecs_component_memory_t components
Component memory.
Definition stats.h:614
ecs_component_index_memory_t component_index
Component index memory.
Definition stats.h:615
Component that stores world statistics.
Definition stats.h:448
ecs_world_stats_t * stats
World statistics data.
Definition stats.h:450
EcsStatsHeader hdr
Statistics header.
Definition stats.h:449
Component that stores a summary of world statistics.
Definition stats.h:466
int32_t component_count
Number of component (data) IDs in the world.
Definition stats.h:488
int64_t systems_ran_frame
Number of systems run in last frame.
Definition stats.h:497
int64_t queries_ran_total
Total number of queries run.
Definition stats.h:485
double frame_time_frame
Time spent processing a frame.
Definition stats.h:492
double simulation_time
Time spent in simulation.
Definition stats.h:502
int64_t entity_count
Number of entities.
Definition stats.h:477
double target_fps
Target FPS.
Definition stats.h:468
double merge_time_total
Total time spent in merges.
Definition stats.h:475
double system_time_frame
Time spent in systems.
Definition stats.h:493
int64_t table_count
Number of tables.
Definition stats.h:478
int64_t observers_ran_total
Total number of times observers were invoked.
Definition stats.h:484
int64_t systems_ran_total
Total number of systems run.
Definition stats.h:483
int64_t frame_count
Number of frames processed.
Definition stats.h:479
int64_t queries_ran_frame
Number of queries run in last frame.
Definition stats.h:499
int32_t pair_count
Number of pair IDs in the world.
Definition stats.h:489
ecs_build_info_t build_info
Build info.
Definition stats.h:506
int64_t merge_count
Number of merges executed.
Definition stats.h:481
int64_t command_count_frame
Number of commands processed in last frame.
Definition stats.h:500
double system_time_total
Total time spent in systems.
Definition stats.h:474
uint32_t uptime
Time since world was created.
Definition stats.h:503
double merge_time_frame
Time spent in merges.
Definition stats.h:494
double frame_time_total
Total time spent processing a frame.
Definition stats.h:473
int64_t merge_count_frame
Number of merges in last frame.
Definition stats.h:496
int32_t tag_count
Number of tag (no data) IDs in the world.
Definition stats.h:487
double time_scale
Simulation time scale.
Definition stats.h:469
double fps
FPS.
Definition stats.h:470
int64_t command_count
Number of commands processed.
Definition stats.h:480
int64_t observers_ran_frame
Number of times observers were invoked in last frame.
Definition stats.h:498
Allocator memory.
Definition stats.h:597
ecs_size_t bytes_sparse_chunk
Sparse chunk allocator.
Definition stats.h:602
ecs_size_t bytes_table_diff
Table diff allocator.
Definition stats.h:601
ecs_size_t bytes_graph_edge
Graph edge allocator.
Definition stats.h:598
ecs_size_t bytes_query_impl
Query struct allocator.
Definition stats.h:606
ecs_size_t bytes_allocator
Generic allocator.
Definition stats.h:603
ecs_size_t bytes_stack_allocator
Stack allocator.
Definition stats.h:604
ecs_size_t bytes_cmd_entry_chunk
Command batching entry chunk allocator.
Definition stats.h:605
ecs_size_t bytes_misc
Miscellaneous allocators.
Definition stats.h:608
ecs_size_t bytes_pair_record
Pair record allocator.
Definition stats.h:600
ecs_size_t bytes_query_cache
Query cache struct allocator.
Definition stats.h:607
ecs_size_t bytes_component_record
Component record allocator.
Definition stats.h:599
Type with information about the current Flecs build.
Definition flecs.h:1489
Component index memory.
Definition stats.h:528
ecs_size_t bytes_children_table_map
Bytes used by map for non-fragmenting ChildOf table lookups.
Definition stats.h:534
int32_t count
Number of component records.
Definition stats.h:529
ecs_size_t bytes_component_record
Bytes used by ecs_component_record_t struct.
Definition stats.h:530
ecs_size_t bytes_ordered_children
Bytes used by ordered children vector.
Definition stats.h:533
ecs_size_t bytes_table_cache
Bytes used by table cache.
Definition stats.h:531
ecs_size_t bytes_name_index
Bytes used by name index.
Definition stats.h:532
ecs_size_t bytes_reachable_cache
Bytes used by reachable cache.
Definition stats.h:535
Component memory.
Definition stats.h:519
ecs_size_t bytes_sparse_components
Bytes used in component sparse sets.
Definition stats.h:524
int32_t instances
Total number of component instances.
Definition stats.h:520
ecs_size_t bytes_table_components_unused
Unused bytes in table columns.
Definition stats.h:522
ecs_size_t bytes_table_components
Bytes used by table columns.
Definition stats.h:521
ecs_size_t bytes_toggle_bitsets
Bytes used in bitsets (toggled components).
Definition stats.h:523
Monotonically increasing counter.
Definition stats.h:51
ecs_gauge_t rate
Keep track of deltas too.
Definition stats.h:52
double value[(60)]
Monotonically increasing values.
Definition stats.h:53
Entity memory.
Definition stats.h:510
int32_t alive_count
Number of alive entities.
Definition stats.h:511
int32_t not_alive_count
Number of not alive entities.
Definition stats.h:512
ecs_size_t bytes_doc_strings
Bytes used by doc strings.
Definition stats.h:515
ecs_size_t bytes_entity_index
Bytes used by entity index.
Definition stats.h:513
ecs_size_t bytes_names
Bytes used by names, symbols, and aliases.
Definition stats.h:514
Simple value that indicates current state.
Definition stats.h:44
ecs_float_t avg[(60)]
Windowed average.
Definition stats.h:45
ecs_float_t min[(60)]
Windowed minimum.
Definition stats.h:46
ecs_float_t max[(60)]
Windowed maximum.
Definition stats.h:47
Misc memory.
Definition stats.h:576
ecs_size_t bytes_component_ids
Memory used for mapping global to world-local component ids.
Definition stats.h:587
ecs_size_t bytes_observers
Memory used by observers.
Definition stats.h:578
ecs_size_t bytes_type_info
Bytes used for storing type information.
Definition stats.h:584
ecs_size_t bytes_reflection
Memory used for component reflection not tracked elsewhere.
Definition stats.h:588
ecs_size_t bytes_stats
Memory used for statistics tracking not tracked elsewhere.
Definition stats.h:591
ecs_size_t bytes_prefab_child_indices
Memory used by map that stores indices for ordered prefab children.
Definition stats.h:590
ecs_size_t bytes_systems
Memory used by systems (excluding system queries).
Definition stats.h:579
ecs_size_t bytes_locked_components
Locked component map.
Definition stats.h:583
ecs_size_t bytes_pipelines
Memory used by pipelines (excluding pipeline queries).
Definition stats.h:580
ecs_size_t bytes_world
Memory used by world and stages.
Definition stats.h:577
ecs_size_t bytes_rematch_monitor
Memory used by monitor used to track rematches.
Definition stats.h:586
ecs_size_t bytes_rest
Memory used by REST HTTP server.
Definition stats.h:592
ecs_size_t bytes_commands
Command queue.
Definition stats.h:585
ecs_size_t bytes_component_record_lookup
Bytes used for component record lookup data structures.
Definition stats.h:582
ecs_size_t bytes_tree_spawner
Memory used for tree (prefab) spawners.
Definition stats.h:589
ecs_size_t bytes_table_lookup
Bytes used for table lookup data structures.
Definition stats.h:581
Statistics for all systems in a pipeline.
Definition stats.h:207
int32_t rebuild_count
Number of times pipeline has rebuilt.
Definition stats.h:222
int32_t system_count
Number of systems in pipeline.
Definition stats.h:220
int8_t canary_
Allow for initializing struct with {0}.
Definition stats.h:208
ecs_vec_t systems
Vector with system IDs of all systems in the pipeline.
Definition stats.h:212
int32_t active_system_count
Number of active systems in pipeline.
Definition stats.h:221
ecs_vec_t sync_points
Vector with sync point stats.
Definition stats.h:215
int32_t t
Current position in ring buffer.
Definition stats.h:218
Query memory.
Definition stats.h:539
ecs_size_t bytes_cache
Bytes used by query cache.
Definition stats.h:543
ecs_size_t bytes_terms
Bytes used by terms array.
Definition stats.h:547
int32_t count
Number of queries.
Definition stats.h:540
ecs_size_t bytes_order_by
Bytes used by table_slices.
Definition stats.h:545
int32_t cached_count
Number of queries with caches.
Definition stats.h:541
ecs_size_t bytes_query
Bytes used by ecs_query_impl_t struct.
Definition stats.h:542
ecs_size_t bytes_misc
Bytes used by remaining misc arrays.
Definition stats.h:548
ecs_size_t bytes_group_by
Bytes used by query cache groups (excludes cache elements).
Definition stats.h:544
ecs_size_t bytes_plan
Bytes used by query plan.
Definition stats.h:546
Statistics for a single query (use ecs_query_cache_stats_get()).
Definition stats.h:172
ecs_metric_t result_count
Number of query results.
Definition stats.h:174
int32_t t
Current position in ring buffer.
Definition stats.h:180
ecs_metric_t matched_table_count
Number of matched tables.
Definition stats.h:175
ecs_metric_t matched_entity_count
Number of matched entities.
Definition stats.h:176
int64_t first_
Used for field iteration.
Definition stats.h:173
int64_t last_
Used for field iteration.
Definition stats.h:177
Queries are lists of constraints (terms) that match entities.
Definition flecs.h:838
Statistics for sync point.
Definition stats.h:195
ecs_metric_t time_spent
Time spent in sync point.
Definition stats.h:197
int64_t first_
Used for field iteration.
Definition stats.h:196
int64_t last_
Used for field iteration.
Definition stats.h:199
int32_t system_count
Number of systems before sync point.
Definition stats.h:201
bool immediate
Whether the sync point is immediate.
Definition stats.h:203
ecs_metric_t commands_enqueued
Number of commands enqueued.
Definition stats.h:198
bool multi_threaded
Whether the sync point is multi-threaded.
Definition stats.h:202
Statistics for a single system (use ecs_system_stats_get()).
Definition stats.h:184
int64_t last_
Used for field iteration.
Definition stats.h:187
int64_t first_
Used for field iteration.
Definition stats.h:185
ecs_query_stats_t query
Query statistics.
Definition stats.h:191
bool task
Whether the system is a task.
Definition stats.h:189
ecs_metric_t time_spent
Time spent processing a system.
Definition stats.h:186
Table size histogram.
Definition stats.h:571
Table memory.
Definition stats.h:556
ecs_size_t bytes_dirty_state
Bytes used by dirty state.
Definition stats.h:566
ecs_size_t bytes_type
Bytes used by type, columns, and table records.
Definition stats.h:561
ecs_size_t bytes_edges
Bytes used by table graph edges.
Definition stats.h:567
ecs_size_t bytes_table
Bytes used by ecs_table_t struct.
Definition stats.h:560
int32_t count
Total number of tables.
Definition stats.h:557
int32_t column_count
Number of table columns.
Definition stats.h:559
ecs_size_t bytes_overrides
Bytes used by table overrides.
Definition stats.h:563
ecs_size_t bytes_component_map
Bytes used by component map.
Definition stats.h:565
int32_t empty_count
Number of empty tables.
Definition stats.h:558
ecs_size_t bytes_entities
Bytes used by entity vectors.
Definition stats.h:562
ecs_size_t bytes_column_map
Bytes used by column map.
Definition stats.h:564
Type that contains world statistics.
Definition stats.h:63
ecs_metric_t alloc_count
Allocs per frame.
Definition stats.h:138
ecs_metric_t block_free_count
Block frees per frame.
Definition stats.h:145
ecs_metric_t batched_count
Number of commands batched.
Definition stats.h:109
ecs_metric_t system_time
Time spent on running systems.
Definition stats.h:128
ecs_metric_t world_time_raw
Actual time passed since simulation start (first time progress() is called).
Definition stats.h:125
ecs_metric_t delete_count
Number of times an ID has been deleted.
Definition stats.h:79
ecs_metric_t busy_count
Number of times server was busy.
Definition stats.h:162
ecs_metric_t rematch_count
Number of query rematches.
Definition stats.h:116
ecs_metric_t frame_time
Time spent processing a frame.
Definition stats.h:127
ecs_metric_t tag_count
Number of tag IDs (IDs without data).
Definition stats.h:74
ecs_metric_t component_count
Number of component IDs (IDs with data).
Definition stats.h:75
ecs_metric_t system_count
Number of systems.
Definition stats.h:94
ecs_metric_t merge_count
Number of merges executed.
Definition stats.h:115
ecs_metric_t free_count
Frees per frame.
Definition stats.h:140
ecs_metric_t query_count
Number of queries.
Definition stats.h:92
ecs_metric_t request_received_count
Number of HTTP requests received.
Definition stats.h:154
ecs_metric_t world_time
Simulation time passed since simulation start.
Definition stats.h:126
ecs_metric_t realloc_count
Reallocs per frame.
Definition stats.h:139
ecs_metric_t merge_time
Time spent on merging commands.
Definition stats.h:130
ecs_metric_t modified_count
Number of modified commands.
Definition stats.h:105
ecs_metric_t set_count
Number of set commands.
Definition stats.h:103
ecs_metric_t outstanding_alloc_count
Difference between allocs and frees.
Definition stats.h:141
ecs_metric_t observers_ran
Number of times an observer was invoked.
Definition stats.h:119
ecs_metric_t frame_count
Number of frames processed.
Definition stats.h:114
ecs_metric_t remove_count
Number of remove commands.
Definition stats.h:100
ecs_metric_t send_ok_count
Number of successful HTTP responses sent.
Definition stats.h:160
ecs_metric_t event_emit_count
Number of events emitted.
Definition stats.h:120
ecs_metric_t discard_count
Number of discarded commands.
Definition stats.h:107
ecs_metric_t empty_count
Number of empty tables.
Definition stats.h:85
ecs_metric_t block_outstanding_alloc_count
Difference between allocs and frees.
Definition stats.h:146
int32_t t
Current position in ring buffer.
Definition stats.h:168
ecs_metric_t stack_free_count
Page frees per frame.
Definition stats.h:148
ecs_metric_t request_handled_error_count
Number of HTTP requests with error response.
Definition stats.h:157
ecs_metric_t send_error_count
Number of HTTP responses with send error.
Definition stats.h:161
ecs_metric_t rematch_time
Time spent on rematching.
Definition stats.h:131
ecs_metric_t fps
Frames per second.
Definition stats.h:132
ecs_metric_t systems_ran
Number of systems run.
Definition stats.h:118
ecs_metric_t type_count
Number of registered types.
Definition stats.h:77
ecs_metric_t count
Number of entities.
Definition stats.h:68
ecs_metric_t clear_count
Number of clear commands.
Definition stats.h:102
ecs_metric_t request_preflight_count
Number of preflight HTTP requests.
Definition stats.h:159
ecs_metric_t other_count
Number of other commands.
Definition stats.h:106
ecs_metric_t request_handled_ok_count
Number of successfully handled HTTP requests.
Definition stats.h:156
ecs_metric_t emit_time
Time spent on notifying observers.
Definition stats.h:129
ecs_metric_t create_count
Number of times an ID has been created.
Definition stats.h:78
ecs_metric_t not_alive_count
Number of not alive (recyclable) entity IDs.
Definition stats.h:69
ecs_metric_t stack_alloc_count
Page allocations per frame.
Definition stats.h:147
ecs_metric_t observer_count
Number of observers.
Definition stats.h:93
int64_t last_
Used for field iteration.
Definition stats.h:165
ecs_metric_t pipeline_build_count
Number of system pipeline rebuilds (occurs when an inactive system becomes active).
Definition stats.h:117
ecs_metric_t stack_outstanding_alloc_count
Difference between allocs and frees.
Definition stats.h:149
ecs_metric_t request_invalid_count
Number of invalid HTTP requests.
Definition stats.h:155
ecs_metric_t block_alloc_count
Block allocations per frame.
Definition stats.h:144
int64_t first_
Used for field iteration.
Definition stats.h:64
ecs_metric_t batched_entity_count
Number of entities for which commands were batched.
Definition stats.h:108
ecs_metric_t ensure_count
Number of ensure commands.
Definition stats.h:104
ecs_metric_t delta_time
Delta time.
Definition stats.h:133
ecs_metric_t add_count
Number of add commands.
Definition stats.h:99
ecs_metric_t request_not_handled_count
Number of unhandled HTTP requests.
Definition stats.h:158
ecs_metric_t pair_count
Number of pair IDs.
Definition stats.h:76
Make all metrics the same size, so we can iterate over fields.
Definition stats.h:57
ecs_gauge_t gauge
Gauge metric.
Definition stats.h:58
ecs_counter_t counter
Counter metric.
Definition stats.h:59