ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
include/ascii-chat/stats/stats.h
Go to the documentation of this file.
1#pragma once
2
6#include <stdbool.h>
7#include <stdint.h>
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
15
16typedef enum {
63
74
90
91typedef struct {
92 const char *name;
93 const char *unit;
94 const char *description;
98
104
116
124
140
146 stats_scope_t **out_scope);
148
154
159typedef void (*stats_observer_fn)(stats_record_kind_t kind, unsigned id,
160 uint64_t value, void *context);
162 void *context);
163
172 uint64_t amount);
175 uint64_t elapsed_ns);
176
192
197
205
212 stats_sampler_t **out_sampler);
213
224 const stats_snapshot_t *snapshot,
225 stats_rates_t *out_rates);
227
228#ifdef __cplusplus
229}
230#endif
Synchronized per-thread pending error stacks and value snapshots. SET_ERRNO pushes,...
unsigned long long uint64_t
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:48
void stats_scope_destroy(stats_scope_t *scope)
void stats_scope_set_observer(stats_scope_t *scope, stats_observer_fn observer, void *context)
void stats_counter_add(stats_scope_t *scope, stats_counter_id_t id, uint64_t amount)
@ STATS_COUNTER_MCP_RENDER_FAILURES
@ STATS_COUNTER_HTTP_BYTES_RECEIVED
@ STATS_COUNTER_SESSION_EXPIRATIONS
@ STATS_COUNTER_RATE_LIMIT_REJECTIONS
@ STATS_COUNTER_MIGRATION_FAILURES
@ STATS_COUNTER_MCP_HTTP_RESPONSES
void stats_duration_record(stats_scope_t *scope, stats_duration_id_t id, uint64_t elapsed_ns)
@ STATS_GAUGE_PARTICIPANTS_ACTIVE
@ STATS_GAUGE_HTTP_CONNECTIONS_ACTIVE
@ STATS_GAUGE_HTTP_STREAMS_ACTIVE
@ STATS_GAUGE_AUDIO_BUFFERED_SAMPLES
void stats_sampler_destroy(stats_sampler_t *sampler)
@ STATS_DURATION_CONNECTION_SETUP
void(* stats_observer_fn)(stats_record_kind_t kind, unsigned id, uint64_t value, void *context)
const stats_descriptor_t * stats_duration_descriptor(stats_duration_id_t id)
asciichat_error_t stats_scope_snapshot(const stats_scope_t *scope, stats_snapshot_t *out)
stats sampler config keeps the values that move through the subsystem: window_ns, resolution_ns....
struct stats_sampler stats_sampler_t
asciichat_error_t stats_scope_create(const stats_capabilities_t *capabilities, stats_scope_t **out_scope)
const stats_descriptor_t * stats_gauge_descriptor(stats_gauge_id_t id)
asciichat_error_t stats_sampler_update(stats_sampler_t *sampler, const stats_snapshot_t *snapshot, stats_rates_t *out_rates)
void stats_gauge_set(stats_scope_t *scope, stats_gauge_id_t id, uint64_t value)
asciichat_error_t stats_sampler_create(const stats_sampler_config_t *config, stats_sampler_t **out_sampler)
const stats_descriptor_t * stats_counter_descriptor(stats_counter_id_t id)
struct stats_scope stats_scope_t
static bool size_t gotel_query_t * out
Definition queries.h:10
stats descriptor is intentionally a small, concrete record. Fields such as name, unit,...
bool counters[STATS_COUNTER_COUNT]
bool durations[STATS_DURATION_COUNT]
double duration_mean_ns[STATS_DURATION_COUNT]
bool duration_valid[STATS_DURATION_COUNT]
double counters_per_second[STATS_COUNTER_COUNT]
This is the handoff point for stats scope. Callers fill observer, observer_context,...
stats duration shard keeps the values that move through the subsystem: owner. Some members are pointe...
stats_capabilities_t capabilities
uint64_t gauges[STATS_GAUGE_COUNT]
uint64_t counters[STATS_COUNTER_COUNT]
stats_duration_snapshot_t durations[STATS_DURATION_COUNT]