40#define ECS_STAT_WINDOW (60)
52 double value[ECS_STAT_WINDOW];
199 int32_t system_count;
259void ecs_world_stats_log(
427 int32_t reduce_count;
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.
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 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 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 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.
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.
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 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 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.
Type with information about the current Flecs build.
Monotonically increasing counter.
ecs_gauge_t rate
Keep track of deltas too.
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.
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_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.