ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
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
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16typedef struct stats_peer stats_peer_t;
17#define STATS_VIEW_LINES 128
34
37typedef void (*stats_provider_fn)(stats_view_t *view, void *data);
39 unsigned interval_seconds);
40void stats_runtime_stop(void);
42void stats_runtime_set_provider(stats_provider_fn provider, void *data);
43void stats_view_add(stats_view_t *view, const char *format, ...);
44void stats_view_add_header(stats_view_t *view, const char *format, ...);
45void stats_runtime_toggle(void);
46bool stats_runtime_active(void);
47stats_peer_t *stats_runtime_peer_open(const char *transport);
52void stats_runtime_packet(stats_peer_t *peer, unsigned type,
53 size_t payload_bytes, bool sent, bool success);
54void stats_runtime_connection_state(const char *state);
55void stats_runtime_media(unsigned width, unsigned height, double position,
56 double duration);
57
58#ifdef __cplusplus
59}
60#endif
unsigned int height
Definition fft.c:24
unsigned int width
Definition fft.c:24
unsigned long long uint64_t
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:48
struct stats_scope stats_scope_t
stats_scope_t * stats_runtime_peer_scope(stats_peer_t *peer)
Definition runtime.c:89
#define STATS_VIEW_LINES
void stats_runtime_set_provider(stats_provider_fn provider, void *data)
Definition runtime.c:134
void stats_view_add_header(stats_view_t *view, const char *format,...)
Definition runtime.c:127
#define STATS_RUNTIME_MODE_BUFFER_SIZE
void stats_runtime_toggle(void)
Definition runtime.c:99
void stats_runtime_connection_state(const char *state)
Definition runtime.c:143
void stats_runtime_peer_close(stats_peer_t *peer)
Definition runtime.c:190
void stats_runtime_media(unsigned width, unsigned height, double position, double duration)
Definition runtime.c:72
#define STATS_VIEW_LINE_BUFFER_SIZE
void stats_runtime_stop(void)
Definition runtime.c:743
void(* stats_provider_fn)(stats_view_t *view, void *data)
bool stats_runtime_active(void)
Definition runtime.c:92
stats_peer_t * stats_runtime_peer_open(const char *transport)
Definition runtime.c:161
struct stats_peer stats_peer_t
void stats_view_add(stats_view_t *view, const char *format,...)
Definition runtime.c:120
void stats_runtime_packet(stats_peer_t *peer, unsigned type, size_t payload_bytes, bool sent, bool success)
Definition runtime.c:205
asciichat_error_t stats_runtime_start(const char *mode, unsigned interval_seconds)
Definition runtime.c:605
stats_scope_t * stats_runtime_scope(void)
Definition runtime.c:88
When code needs to work with stats peer, it keeps scope, sampler, id here instead of scattering it ac...
Definition runtime.c:49
uint64_t sampled_ns
char mode[32]
bool headings[128]
unsigned page
char lines[128][160]
unsigned selected
unsigned offset
unsigned count