notcurses/doc/man/man3/notcurses_stats.3.md
Nick Black f6975d11d5
Docs/API sweep for 1.0.0 #244 #249 (#250)
* sync up some docs #244
* sync README and man page
* notcurses_output() man page work
* pull attr/channels from output functions #244
* witherworm: clean up explicit moves #244
* still more man page work
* notcurses_lines, last of the man pages i think
* panelreel man page #244
* debian: ruby-ronn->pandoc
* debian: full multiarch compliance
* debian: symbols file
* pandoc: fix syntax for lexgrog
* fm6.mkv: strip audio
* pandoc: fix up apropos man syntax #249
* ncurses_lines man page
2020-01-04 02:37:55 -05:00

57 lines
1.7 KiB
Markdown

% notcurses_stats(3)
% nick black <nickblack@linux.com>
% v1.0.0
# NAME
notcurses_stats - notcurses runtime statistics
# SYNOPSIS
**#include <notcurses.h>**
```c
typedef struct ncstats {
uint64_t renders; // number of successful renders
uint64_t failed_renders; // aborted renders, should be 0
uint64_t render_bytes; // bytes emitted to ttyfp
int64_t render_max_bytes; // max bytes emitted for a frame
int64_t render_min_bytes; // min bytes emitted for a frame
uint64_t render_ns; // nanoseconds spent rendering
int64_t render_max_ns; // max ns spent rendering
int64_t render_min_ns; // min ns spent rendering
uint64_t cellelisions; // cells elided entirely
uint64_t cellemissions; // cells emitted
uint64_t fbbytes; // bytes devoted to framebuffers
uint64_t fgelisions; // RGB fg elision count
uint64_t fgemissions; // RGB fg emissions
uint64_t bgelisions; // RGB bg elision count
uint64_t bgemissions; // RGB bg emissions
uint64_t defaultelisions; // default color was emitted
uint64_t defaultemissions; // default color was elided
} ncstats;
```
**void notcurses_stats(struct notcurses* nc, ncstats* stats);**
**void notcurses_reset_stats(struct notcurses* nc, ncstats* stats);**
# DESCRIPTION
**notcurses_stats** acquires an atomic snapshot of statistics, primarily
related to notcurses_render(3). **notcurses_reset_stats** does the same, but
also resets all cumulative stats (immediate stats such as **fbbytes** are not
reset).
# NOTES
Unsuccessful render operations do not contribute to the render timing stats.
# RETURN VALUES
Neither of these functions can fail. Neither returns any value.
# SEE ALSO
**notcurses(3)**, **notcurses_render(3)**