40#define ECS_STAT_WINDOW (60)
52 double value[ECS_STAT_WINDOW];
199 int32_t system_count;
259void ecs_world_stats_log(
438 int32_t reduce_count;
530#define ECS_TABLE_MEMORY_HISTOGRAM_BUCKET_COUNT 14
531#define ECS_TABLE_MEMORY_HISTOGRAM_MAX_COUNT (1 << ECS_TABLE_MEMORY_HISTOGRAM_BUCKET_COUNT)
557 ecs_size_t bytes_queue;
565 ecs_size_t bytes_graph_edge;
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.
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.
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 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.
FLECS_API ecs_query_memory_t ecs_query_memory_get(const ecs_world_t *world)
Get memory usage statistics for queries.
FLECS_API ecs_table_memory_t ecs_table_memory_get(const ecs_world_t *world)
Get memory usage statistics for tables.
struct ecs_query_stats_t ecs_query_stats_t
Statistics for a single query (use ecs_query_cache_stats_get)
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_index_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 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.
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.
FLECS_API ecs_commands_memory_t ecs_commands_memory_get(const ecs_world_t *world)
Get memory usage statistics for commands.
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.
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.
ecs_id_t ecs_entity_t
An entity identifier.
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
#define ECS_COMPONENT_DECLARE(id)
Forward declare a component.
#define ecs_ftime_t
Customizable precision for scalar time values.
#define ecs_float_t
Customizable precision for floating point operations.
Component that stores pipeline statistics.
Component that stores system statistics.
Component with memory statistics.
Component that stores world statistics.
Component that stores a summary of world statistics.
double target_fps
Target FPS.
double merge_time_total
Total time spent in merges.
double frame_time_last
Time spent processing a frame.
int64_t frame_count
Number of frames processed.
double system_time_last
Time spent in systems.
ecs_build_info_t build_info
Build info.
double system_time_total
Total time spent in systems.
double frame_time_total
Total time spent processing a frame.
double merge_time_last
Time spent in merges.
double time_scale
Simulation time scale.
int64_t command_count
Number of commands processed.
ecs_size_t bytes_sparse_chunk
Table diff allocator.
ecs_size_t bytes_table_diff
Pair record allocator.
ecs_size_t bytes_query_impl
Command batching entry chunk allocator.
ecs_size_t bytes_allocator
Hashmap allocator.
ecs_size_t bytes_hashmap
Sparse chunk allocator.
ecs_size_t bytes_cmd_entry_chunk
Generic allocator.
ecs_size_t bytes_pair_record
Component record allocator.
ecs_size_t bytes_query_cache
Query struct allocator.
ecs_size_t bytes_component_record
Graph edge allocator.
Type with information about the current Flecs build.
ecs_size_t bytes_entries
Queue size.
ecs_size_t bytes_stack
Size of sparse set used for command batching.
ecs_size_t bytes_component_record
Number of component records.
ecs_size_t bytes_ordered_children
Bytes used by name index.
ecs_size_t bytes_table_cache
Bytes used by ecs_component_record_t struct.
ecs_size_t bytes_name_index
Bytes used by table cache.
ecs_size_t bytes_reachable_cache
Bytes used by ordered children vector.
ecs_size_t bytes_type_info
Bytes used by reachable cache.
ecs_size_t bytes_sparse_components
Bytes used in bitsets (toggled components).
ecs_size_t bytes_builtin
Sparse set overhead.
ecs_size_t bytes_sparse_components_unused
Bytes used in component sparse sets.
ecs_size_t bytes_sparse_overhead
Unused bytes in component sparse sets.
ecs_size_t bytes_table_components_unused
Bytes used by table columns.
ecs_size_t bytes_table_components
Total number of component instances.
ecs_size_t bytes_toggle_bitsets
Unused bytes in table columns.
Monotonically increasing counter.
ecs_gauge_t rate
Keep track of deltas too.
ecs_size_t bytes_alive
Number of not alive entities.
int32_t not_alive_count
Number of alive entities.
ecs_size_t bytes_doc_names
Bytes used by names.
ecs_size_t bytes_not_alive
Bytes used by alive entities.
ecs_size_t bytes_unused
Bytes used by not alive entities.
ecs_size_t bytes_names
Allocated but unused bytes.
Simple value that indicates current state.
Statistics for all systems in a pipeline.
int32_t rebuild_count
Number of times pipeline has rebuilt.
int32_t system_count
Number of systems in pipeline.
ecs_vec_t systems
Vector with system ids of all systems in the pipeline.
int32_t active_system_count
Number of active systems in pipeline.
ecs_vec_t sync_points
Vector with sync point stats.
int32_t t
Current position in ring buffer.
ecs_size_t bytes_cache
Bytes used by ecs_query_impl_t struct.
ecs_size_t bytes_terms
Bytes used by query plan.
ecs_size_t bytes_order_by
Bytes used by query cache groups (excludes cache elements).
int32_t cached_count
Number of queries.
ecs_size_t bytes_query
Number of queries with caches.
ecs_size_t bytes_misc
Bytes used by terms array.
ecs_size_t bytes_group_by
Bytes used by query cache.
ecs_size_t bytes_plan
Bytes used by table_slices.
Statistics for a single query (use ecs_query_cache_stats_get)
ecs_metric_t result_count
Number of query results.
int32_t t
Current position in ringbuffer.
ecs_metric_t matched_table_count
Number of matched tables.
ecs_metric_t matched_entity_count
Number of matched entities.
Queries are lists of constraints (terms) that match entities.
Statistics for sync point.
Statistics for a single system (use ecs_system_stats_get())
bool task
Is system a task.
ecs_metric_t time_spent
Time spent processing a system.
ecs_size_t bytes_dirty_state
Bytes used by column map.
ecs_size_t bytes_type
Bytes used by ecs_table_t struct.
ecs_size_t bytes_edges
Bytes used by column map.
ecs_size_t bytes_table
Number of table columns.
int32_t column_count
Number of empty tables.
ecs_size_t bytes_overrides
Bytes used by entity vectors.
ecs_size_t bytes_columns
Bytes used by table overrides.
ecs_size_t bytes_table_records
Bytes used by table columns (excluding component data).
ecs_size_t bytes_component_map
Bytes used by column map.
int32_t empty_count
Total number of tables.
ecs_size_t bytes_entities
Bytes used by type vector.
ecs_size_t bytes_column_map
Bytes used by table records.
ecs_metric_t alloc_count
Allocs per frame.
ecs_metric_t block_free_count
Block frees per frame.
ecs_metric_t system_time
Time spent on running systems.
ecs_metric_t world_time_raw
Actual time passed since simulation start (first time progress() is called)
ecs_metric_t delete_count
Number of times id has been deleted.
ecs_metric_t rematch_count
Number of query rematches.
ecs_metric_t frame_time
Time spent processing a frame.
ecs_metric_t tag_count
Number of tag ids (ids without data)
ecs_metric_t component_count
Number of components ids (ids with data)
ecs_metric_t system_count
Number of systems.
ecs_metric_t merge_count
Number of merges executed.
ecs_metric_t free_count
Frees per frame.
ecs_metric_t query_count
Number of queries.
ecs_metric_t world_time
Simulation time passed since simulation start.
ecs_metric_t realloc_count
Reallocs per frame.
ecs_metric_t merge_time
Time spent on merging commands.
ecs_metric_t outstanding_alloc_count
Difference between allocs & frees.
ecs_metric_t observers_ran
Number of times an observer was invoked.
ecs_metric_t frame_count
Number of frames processed.
ecs_metric_t event_emit_count
Number of events emitted.
ecs_metric_t empty_count
Number of empty tables.
ecs_metric_t block_outstanding_alloc_count
Difference between allocs & frees.
int32_t t
Current position in ring buffer.
ecs_metric_t stack_free_count
Page frees per frame.
ecs_metric_t rematch_time
Time spent on rematching.
ecs_metric_t fps
Frames per second.
ecs_metric_t systems_ran
Number of systems ran.
ecs_metric_t type_count
Number of registered types.
ecs_metric_t count
Number of entities.
ecs_metric_t emit_time
Time spent on notifying observers.
ecs_metric_t create_count
Number of times id has been created.
ecs_metric_t not_alive_count
Number of not alive (recyclable) entity ids.
ecs_metric_t stack_alloc_count
Page allocations per frame.
ecs_metric_t observer_count
Number of observers.
ecs_metric_t pipeline_build_count
Number of system pipeline rebuilds (occurs when an inactive system becomes active).
ecs_metric_t stack_outstanding_alloc_count
Difference between allocs & frees.
ecs_metric_t block_alloc_count
Block allocations per frame.
ecs_metric_t delta_time
Delta_time.
ecs_metric_t pair_count
Number of pair ids.
Make all metrics the same size, so we can iterate over fields.