ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
stats/runtime.h
Go to the documentation of this file.
1#pragma once
2
3/* Storage capacities in elements; text buffers include the terminating NUL. */
4#define STATS_RUNTIME_MODE_BUFFER_SIZE 32
5
6/* Existing buffer budgets in bytes, including NUL for text storage. */
7#define STATS_VIEW_LINE_BUFFER_SIZE 160
8
10#include <stddef.h>
11
12typedef struct stats_peer stats_peer_t;
13#define STATS_VIEW_LINES 128
27
30typedef void (*stats_provider_fn)(stats_view_t *view, void *data);
31asciichat_error_t stats_runtime_start(const char *mode, unsigned interval_seconds);
32void stats_runtime_stop(void);
34void stats_runtime_set_provider(stats_provider_fn provider, void *data);
35void stats_view_add(stats_view_t *view, const char *format, ...);
36void stats_view_add_header(stats_view_t *view, const char *format, ...);
37void stats_runtime_toggle(void);
38bool stats_runtime_active(void);
39stats_peer_t *stats_runtime_peer_open(const char *transport);
43void stats_runtime_packet(stats_peer_t *peer, unsigned type, size_t payload_bytes, bool sent, bool success);
44void stats_runtime_connection_state(const char *state);
45void stats_runtime_media(unsigned width, unsigned height, double position, double duration);
unsigned int height
Definition fft.c:23
unsigned int width
Definition fft.c:23
unsigned long long uint64_t
Definition common.h:63
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:44
struct stats_scope stats_scope_t
stats_scope_t * stats_runtime_peer_scope(stats_peer_t *peer)
Definition runtime.c:83
#define STATS_VIEW_LINES
void stats_runtime_set_provider(stats_provider_fn provider, void *data)
Definition runtime.c:126
void stats_view_add_header(stats_view_t *view, const char *format,...)
Definition runtime.c:119
#define STATS_RUNTIME_MODE_BUFFER_SIZE
void stats_runtime_toggle(void)
Definition runtime.c:92
void stats_runtime_connection_state(const char *state)
Definition runtime.c:135
void stats_runtime_peer_close(stats_peer_t *peer)
Definition runtime.c:181
void stats_runtime_media(unsigned width, unsigned height, double position, double duration)
Definition runtime.c:69
#define STATS_VIEW_LINE_BUFFER_SIZE
void stats_runtime_stop(void)
Definition runtime.c:639
void(* stats_provider_fn)(stats_view_t *view, void *data)
bool stats_runtime_active(void)
Definition runtime.c:86
stats_peer_t * stats_runtime_peer_open(const char *transport)
Definition runtime.c:152
struct stats_peer stats_peer_t
void stats_view_add(stats_view_t *view, const char *format,...)
Definition runtime.c:112
void stats_runtime_packet(stats_peer_t *peer, unsigned type, size_t payload_bytes, bool sent, bool success)
Definition runtime.c:196
asciichat_error_t stats_runtime_start(const char *mode, unsigned interval_seconds)
Definition runtime.c:520
stats_scope_t * stats_runtime_scope(void)
Definition runtime.c:80
When code needs to work with stats peer, it keeps scope, sampler, id here instead of scattering it ac...
Definition runtime.c:48
uint64_t sampled_ns
char mode[32]
bool headings[128]
unsigned page
char lines[128][160]
unsigned selected
unsigned offset
unsigned count