ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
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",
6 "MCP protocol messages handled"},
7 [STATS_COUNTER_MCP_REJECTED] = {"mcp_rejected", "requests",
8 "Rejected MCP protocol or tool requests"},
9 [STATS_COUNTER_MCP_RENDERS] = {"mcp_renders", "renders",
10 "MCP render jobs started"},
11 [STATS_COUNTER_MCP_RENDER_FAILURES] = {"mcp_render_failures", "renders",
12 "MCP render jobs which failed"},
13 [STATS_COUNTER_MCP_CANCELLED] = {"mcp_cancelled", "renders",
14 "MCP render jobs cancelled"},
15 [STATS_COUNTER_MCP_TIMEOUTS] = {"mcp_timeouts", "renders",
16 "MCP render jobs exceeding their deadline"},
18 {"mcp_output_bytes", "bytes",
19 "ASCII bytes captured from MCP render workers"},
20 [STATS_COUNTER_MCP_SAVED_FILES] = {"mcp_saved_files", "files",
21 "MCP image or video files saved"},
22 [STATS_COUNTER_MCP_HTTP_RESPONSES] = {"mcp_http_responses", "responses",
23 "MCP HTTP responses sent"},
24 [STATS_COUNTER_HTTP_REQUESTS] = {"http_requests", "requests",
25 "HTTP requests received"},
26 [STATS_COUNTER_HTTP_ERRORS] = {"http_errors", "errors",
27 "HTTP error responses sent"},
28 [STATS_COUNTER_HTTP_REJECTED] = {"http_rejected", "requests",
29 "HTTP requests rejected before dispatch"},
30 [STATS_COUNTER_HTTP_CANCELLED] = {"http_cancelled", "requests",
31 "HTTP requests cancelled"},
32 [STATS_COUNTER_HTTP_BYTES_RECEIVED] = {"http_bytes_received", "bytes",
33 "HTTP request bytes received"},
34 [STATS_COUNTER_HTTP_BYTES_SENT] = {"http_bytes_sent", "bytes",
35 "HTTP response bytes sent"},
36
38 {"frames_enqueued", "frames",
39 "Successful frame queue submissions (fanout counted separately)"},
40 [STATS_COUNTER_QUEUE_DROPS] = {"queue_drops", "frames",
41 "Frames discarded because a queue is full"},
43 {"migration_failures", "events",
44 "Host migrations which failed or timed out"},
45 [STATS_COUNTER_RECONNECTS] = {"reconnects", "attempts",
46 "Connection retries after the first attempt"},
48 {"recording_frames", "frames",
49 "Frames accepted by the recording encoder"},
50 [STATS_COUNTER_FRAMES_SENT] = {"frames_sent", "frames",
51 "Media frames accepted by the transport"},
52 [STATS_COUNTER_FRAMES_RECEIVED] = {"frames_received", "frames",
53 "Decrypted media packets received"},
54 [STATS_COUNTER_FRAMES_CAPTURED] = {"frames_captured", "frames",
55 "Frames acquired from a media source"},
56 [STATS_COUNTER_FRAMES_CONVERTED] = {"frames_converted", "frames",
57 "Successful ASCII frame conversions"},
58 [STATS_COUNTER_FRAMES_ENCODED] = {"frames_encoded", "frames",
59 "Successfully encoded video frames"},
61 {"frames_decoded", "frames",
62 "Successfully decoded H.265 or ASCII frames"},
64 {"frames_presented", "frames",
65 "Complete media frames written to the terminal"},
66 [STATS_COUNTER_FRAMES_SKIPPED] = {"frames_skipped", "frames",
67 "Frames deliberately skipped by policy"},
69 {"frames_dropped", "frames",
70 "Frames lost to capacity limits or processing failures"},
71 [STATS_COUNTER_PACKETS_SENT] = {"packets_sent", "packets",
72 "Successfully sent application packets"},
73 [STATS_COUNTER_PACKETS_RECEIVED] = {"packets_received", "packets",
74 "Received application packets"},
76 {"bytes_sent", "bytes",
77 "Sent ACIP header and payload bytes, excluding transport overhead"},
78 [STATS_COUNTER_BYTES_RECEIVED] = {"bytes_received", "bytes",
79 "Received ACIP header and payload bytes, "
80 "excluding transport overhead"},
81 [STATS_COUNTER_SEND_ERRORS] = {"send_errors", "errors",
82 "Failed application send operations"},
83 [STATS_COUNTER_RECEIVE_ERRORS] = {"receive_errors", "errors",
84 "Failed application receive operations"},
85 [STATS_COUNTER_AUDIO_UNDERRUNS] = {"audio_underruns", "events",
86 "Playback buffer underrun events"},
87 [STATS_COUNTER_AUDIO_OVERRUNS] = {"audio_overruns", "events",
88 "Audio buffer overrun events"},
89 [STATS_COUNTER_SESSION_CREATES] = {"session_creates", "sessions",
90 "Successful session creations"},
91 [STATS_COUNTER_SESSION_JOINS] = {"session_joins", "joins",
92 "Successful session joins"},
93 [STATS_COUNTER_SESSION_LOOKUPS] = {"session_lookups", "requests",
94 "Successful session lookups"},
95 [STATS_COUNTER_REQUEST_FAILURES] = {"request_failures", "requests",
96 "Failed service requests"},
98 {"rate_limit_rejections", "requests",
99 "Requests rejected by rate limiting"},
100 [STATS_COUNTER_SESSION_EXPIRATIONS] = {"session_expirations", "sessions",
101 "Sessions removed by expiration"},
102 [STATS_COUNTER_HOST_MIGRATIONS] = {"host_migrations", "events",
103 "Completed host migrations"},
104};
105
106static const stats_descriptor_t gauge_descriptors[STATS_GAUGE_COUNT] = {
107 [STATS_GAUGE_CONNECTIONS_ACTIVE] = {"connections_active", "connections",
108 "Currently connected peers"},
109 [STATS_GAUGE_SESSIONS_ACTIVE] = {"sessions_active", "sessions",
110 "Currently active sessions"},
111 [STATS_GAUGE_PARTICIPANTS_ACTIVE] = {"participants_active", "participants",
112 "Currently active participants"},
113 [STATS_GAUGE_VIDEO_QUEUE_DEPTH] = {"video_queue_depth", "frames",
114 "Frames currently queued for delivery"},
116 {"audio_buffered_samples", "samples",
117 "Buffered audio sample frames per channel"},
118 [STATS_GAUGE_HTTP_CONNECTIONS_ACTIVE] = {"http_connections_active",
119 "connections",
120 "Active HTTP connections"},
121 [STATS_GAUGE_HTTP_STREAMS_ACTIVE] = {"http_streams_active", "streams",
122 "Active HTTP request streams"},
123};
124
125static const stats_descriptor_t duration_descriptors[STATS_DURATION_COUNT] = {
127 {"mcp_render", "ns",
128 "MCP render worker attempt including output publication"},
130 {"recording", "ns", "Recording frame conversion and encoding attempt"},
132 {"capture", "ns", "Media acquisition attempt, including source wait"},
134 {"ascii_convert", "ns",
135 "ASCII conversion attempt, excluding capture and output"},
136 [STATS_DURATION_ENCODE] = {"encode", "ns",
137 "Video codec encode call, excluding queue wait"},
139 {"decode", "ns", "Media payload decode attempt, excluding queue wait"},
140 [STATS_DURATION_AUDIO_MIX] = {"audio_mix", "ns",
141 "Audio mixing attempt, excluding playback"},
143 {"terminal_write", "ns",
144 "Media frame write attempt, including output blocking"},
146 {"connection_setup", "ns",
147 "Connection attempt through readiness or failure"},
149 {"request", "ns",
150 "Service request handling through response submission or failure"},
151 [STATS_DURATION_RTT] = {"rtt", "ns",
152 "Matched probe send-to-response elapsed time; "
153 "excludes unanswered probes"},
155 {"http_request", "ns",
156 "HTTP request handling through response submission"},
157};
158
160 return (unsigned)id < STATS_COUNTER_COUNT ? &counter_descriptors[id] : NULL;
161}
162
164 return (unsigned)id < STATS_GAUGE_COUNT ? &gauge_descriptors[id] : NULL;
165}
166
168 return (unsigned)id < STATS_DURATION_COUNT ? &duration_descriptors[id] : NULL;
169}
const stats_descriptor_t * stats_duration_descriptor(stats_duration_id_t id)
const stats_descriptor_t * stats_gauge_descriptor(stats_gauge_id_t id)
const stats_descriptor_t * stats_counter_descriptor(stats_counter_id_t id)
@ 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