ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
descriptors.c
Go to the documentation of this file.
2#include <stddef.h>
3
4static const stats_descriptor_t counter_descriptors[STATS_COUNTER_COUNT] = {
5 [STATS_COUNTER_MCP_REQUESTS] = {"mcp_requests", "requests", "MCP protocol messages handled"},
6 [STATS_COUNTER_MCP_REJECTED] = {"mcp_rejected", "requests", "Rejected MCP protocol or tool requests"},
7 [STATS_COUNTER_MCP_RENDERS] = {"mcp_renders", "renders", "MCP render jobs started"},
8 [STATS_COUNTER_MCP_RENDER_FAILURES] = {"mcp_render_failures", "renders", "MCP render jobs which failed"},
9 [STATS_COUNTER_MCP_CANCELLED] = {"mcp_cancelled", "renders", "MCP render jobs cancelled"},
10 [STATS_COUNTER_MCP_TIMEOUTS] = {"mcp_timeouts", "renders", "MCP render jobs exceeding their deadline"},
11 [STATS_COUNTER_MCP_OUTPUT_BYTES] = {"mcp_output_bytes", "bytes", "ASCII bytes captured from MCP render workers"},
12 [STATS_COUNTER_MCP_SAVED_FILES] = {"mcp_saved_files", "files", "MCP image or video files saved"},
13 [STATS_COUNTER_MCP_HTTP_RESPONSES] = {"mcp_http_responses", "responses", "MCP HTTP responses sent"},
14 [STATS_COUNTER_HTTP_REQUESTS] = {"http_requests", "requests", "HTTP requests received"},
15 [STATS_COUNTER_HTTP_ERRORS] = {"http_errors", "errors", "HTTP error responses sent"},
16 [STATS_COUNTER_HTTP_REJECTED] = {"http_rejected", "requests", "HTTP requests rejected before dispatch"},
17 [STATS_COUNTER_HTTP_CANCELLED] = {"http_cancelled", "requests", "HTTP requests cancelled"},
18 [STATS_COUNTER_HTTP_BYTES_RECEIVED] = {"http_bytes_received", "bytes", "HTTP request bytes received"},
19 [STATS_COUNTER_HTTP_BYTES_SENT] = {"http_bytes_sent", "bytes", "HTTP response bytes sent"},
20
21 [STATS_COUNTER_FRAMES_ENQUEUED] = {"frames_enqueued", "frames",
22 "Successful frame queue submissions (fanout counted separately)"},
23 [STATS_COUNTER_QUEUE_DROPS] = {"queue_drops", "frames", "Frames discarded because a queue is full"},
24 [STATS_COUNTER_MIGRATION_FAILURES] = {"migration_failures", "events", "Host migrations which failed or timed out"},
25 [STATS_COUNTER_RECONNECTS] = {"reconnects", "attempts", "Connection retries after the first attempt"},
26 [STATS_COUNTER_RECORDING_FRAMES] = {"recording_frames", "frames", "Frames accepted by the recording encoder"},
27 [STATS_COUNTER_FRAMES_SENT] = {"frames_sent", "frames", "Media frames accepted by the transport"},
28 [STATS_COUNTER_FRAMES_RECEIVED] = {"frames_received", "frames", "Decrypted media packets received"},
29 [STATS_COUNTER_FRAMES_CAPTURED] = {"frames_captured", "frames", "Frames acquired from a media source"},
30 [STATS_COUNTER_FRAMES_CONVERTED] = {"frames_converted", "frames", "Successful ASCII frame conversions"},
31 [STATS_COUNTER_FRAMES_ENCODED] = {"frames_encoded", "frames", "Successfully encoded video frames"},
32 [STATS_COUNTER_FRAMES_DECODED] = {"frames_decoded", "frames", "Successfully decoded H.265 or ASCII frames"},
33 [STATS_COUNTER_FRAMES_PRESENTED] = {"frames_presented", "frames", "Complete media frames written to the terminal"},
34 [STATS_COUNTER_FRAMES_SKIPPED] = {"frames_skipped", "frames", "Frames deliberately skipped by policy"},
35 [STATS_COUNTER_FRAMES_DROPPED] = {"frames_dropped", "frames",
36 "Frames lost to capacity limits or processing failures"},
37 [STATS_COUNTER_PACKETS_SENT] = {"packets_sent", "packets", "Successfully sent application packets"},
38 [STATS_COUNTER_PACKETS_RECEIVED] = {"packets_received", "packets", "Received application packets"},
39 [STATS_COUNTER_BYTES_SENT] = {"bytes_sent", "bytes",
40 "Sent ACIP header and payload bytes, excluding transport overhead"},
41 [STATS_COUNTER_BYTES_RECEIVED] = {"bytes_received", "bytes",
42 "Received ACIP header and payload bytes, excluding transport overhead"},
43 [STATS_COUNTER_SEND_ERRORS] = {"send_errors", "errors", "Failed application send operations"},
44 [STATS_COUNTER_RECEIVE_ERRORS] = {"receive_errors", "errors", "Failed application receive operations"},
45 [STATS_COUNTER_AUDIO_UNDERRUNS] = {"audio_underruns", "events", "Playback buffer underrun events"},
46 [STATS_COUNTER_AUDIO_OVERRUNS] = {"audio_overruns", "events", "Audio buffer overrun events"},
47 [STATS_COUNTER_SESSION_CREATES] = {"session_creates", "sessions", "Successful session creations"},
48 [STATS_COUNTER_SESSION_JOINS] = {"session_joins", "joins", "Successful session joins"},
49 [STATS_COUNTER_SESSION_LOOKUPS] = {"session_lookups", "requests", "Successful session lookups"},
50 [STATS_COUNTER_REQUEST_FAILURES] = {"request_failures", "requests", "Failed service requests"},
51 [STATS_COUNTER_RATE_LIMIT_REJECTIONS] = {"rate_limit_rejections", "requests", "Requests rejected by rate limiting"},
52 [STATS_COUNTER_SESSION_EXPIRATIONS] = {"session_expirations", "sessions", "Sessions removed by expiration"},
53 [STATS_COUNTER_HOST_MIGRATIONS] = {"host_migrations", "events", "Completed host migrations"},
54};
55
56static const stats_descriptor_t gauge_descriptors[STATS_GAUGE_COUNT] = {
57 [STATS_GAUGE_CONNECTIONS_ACTIVE] = {"connections_active", "connections", "Currently connected peers"},
58 [STATS_GAUGE_SESSIONS_ACTIVE] = {"sessions_active", "sessions", "Currently active sessions"},
59 [STATS_GAUGE_PARTICIPANTS_ACTIVE] = {"participants_active", "participants", "Currently active participants"},
60 [STATS_GAUGE_VIDEO_QUEUE_DEPTH] = {"video_queue_depth", "frames", "Frames currently queued for delivery"},
61 [STATS_GAUGE_AUDIO_BUFFERED_SAMPLES] = {"audio_buffered_samples", "samples",
62 "Buffered audio sample frames per channel"},
63 [STATS_GAUGE_HTTP_CONNECTIONS_ACTIVE] = {"http_connections_active", "connections", "Active HTTP connections"},
64 [STATS_GAUGE_HTTP_STREAMS_ACTIVE] = {"http_streams_active", "streams", "Active HTTP request streams"},
65};
66
67static const stats_descriptor_t duration_descriptors[STATS_DURATION_COUNT] = {
68 [STATS_DURATION_MCP_RENDER] = {"mcp_render", "ns", "MCP render worker attempt including output publication"},
69 [STATS_DURATION_RECORDING] = {"recording", "ns", "Recording frame conversion and encoding attempt"},
70 [STATS_DURATION_CAPTURE] = {"capture", "ns", "Media acquisition attempt, including source wait"},
71 [STATS_DURATION_ASCII_CONVERT] = {"ascii_convert", "ns", "ASCII conversion attempt, excluding capture and output"},
72 [STATS_DURATION_ENCODE] = {"encode", "ns", "Video codec encode call, excluding queue wait"},
73 [STATS_DURATION_DECODE] = {"decode", "ns", "Media payload decode attempt, excluding queue wait"},
74 [STATS_DURATION_AUDIO_MIX] = {"audio_mix", "ns", "Audio mixing attempt, excluding playback"},
75 [STATS_DURATION_TERMINAL_WRITE] = {"terminal_write", "ns", "Media frame write attempt, including output blocking"},
76 [STATS_DURATION_CONNECTION_SETUP] = {"connection_setup", "ns", "Connection attempt through readiness or failure"},
77 [STATS_DURATION_REQUEST] = {"request", "ns", "Service request handling through response submission or failure"},
78 [STATS_DURATION_RTT] = {"rtt", "ns", "Matched probe send-to-response elapsed time; excludes unanswered probes"},
79 [STATS_DURATION_HTTP_REQUEST] = {"http_request", "ns", "HTTP request handling through response submission"},
80};
81
83 return (unsigned)id < STATS_COUNTER_COUNT ? &counter_descriptors[id] : NULL;
84}
85
87 return (unsigned)id < STATS_GAUGE_COUNT ? &gauge_descriptors[id] : NULL;
88}
89
91 return (unsigned)id < STATS_DURATION_COUNT ? &duration_descriptors[id] : NULL;
92}
const stats_descriptor_t * stats_duration_descriptor(stats_duration_id_t id)
Definition descriptors.c:90
const stats_descriptor_t * stats_gauge_descriptor(stats_gauge_id_t id)
Definition descriptors.c:86
const stats_descriptor_t * stats_counter_descriptor(stats_counter_id_t id)
Definition descriptors.c:82
@ 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
@ STATS_GAUGE_PARTICIPANTS_ACTIVE
@ STATS_GAUGE_HTTP_CONNECTIONS_ACTIVE
@ STATS_GAUGE_HTTP_STREAMS_ACTIVE
@ STATS_GAUGE_AUDIO_BUFFERED_SAMPLES
@ STATS_DURATION_CONNECTION_SETUP