Skip to content

Commit

Permalink
reorder ncstats fields to match documentation #1777
Browse files Browse the repository at this point in the history
  • Loading branch information
dankamongmen committed Oct 16, 2021
1 parent 962087a commit 021a6ea
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 25 deletions.
13 changes: 7 additions & 6 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3529,12 +3529,12 @@ typedef struct ncstats {
uint64_t writeouts; // successful ncpile_rasterize() runs
uint64_t failed_renders; // aborted renders, should be 0
uint64_t failed_writeouts; // aborted writes
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 raster_bytes; // bytes emitted to ttyfp
int64_t raster_max_bytes; // max bytes emitted for a frame
int64_t raster_min_bytes; // min bytes emitted for a frame
uint64_t render_ns; // nanoseconds spent rendering
int64_t render_max_ns; // max ns spent in render+raster for a frame
int64_t render_min_ns; // min ns spent in render+raster for a frame
int64_t render_max_ns; // max ns spent in render for a frame
int64_t render_min_ns; // min ns spent in render for a frame
uint64_t raster_ns; // nanoseconds spent rasterizing
int64_t raster_max_ns; // max ns spent in raster for a frame
int64_t raster_min_ns; // min ns spent in raster for a frame
Expand All @@ -3553,8 +3553,9 @@ typedef struct ncstats {
uint64_t sprixelemissions; // sprixel draw count
uint64_t sprixelelisions; // sprixel elision count
uint64_t sprixelbytes; // sprixel bytes emitted
uint64_t appsync_updates; // application-synchronized updates
uint64_t appsync_updates; // how many application-synchronized updates?
uint64_t input_errors; // errors processing control sequences/utf8
uint64_t input_events; // characters returned to userspace
// current state -- these can decrease
uint64_t fbbytes; // total bytes devoted to all active framebuffers
Expand Down
10 changes: 5 additions & 5 deletions doc/man/man3/notcurses_stats.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ typedef struct ncstats {
uint64_t writeouts; // successful ncpile_rasterize() runs
uint64_t failed_renders; // aborted renders, should be 0
uint64_t failed_writeouts; // aborted writes
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 raster_bytes; // bytes emitted to ttyfp
int64_t raster_max_bytes; // max bytes emitted for a frame
int64_t raster_min_bytes; // min bytes emitted for a frame
uint64_t render_ns; // nanoseconds spent rendering
int64_t render_max_ns; // max ns spent for a frame
int64_t render_min_ns; // min ns spent for a frame
Expand Down Expand Up @@ -75,7 +75,7 @@ renders are not expected to fail except under exceptional circumstances.
should **notcurses_render(3)** fail while writing out a frame to the terminal,
it counts as a failed render.

**render_max_bytes** and **render_min_bytes** track the maximum and minimum
**raster_max_bytes** and **raster_min_bytes** track the maximum and minimum
number of bytes used rasterizing a frame. A given state of Notcurses does not
correspond to a unique number of bytes; the size is also dependent on the
existing terminal state. As a first approximation, the time a terminal takes to
Expand Down Expand Up @@ -125,7 +125,7 @@ Linux framebuffer bitmaps are not written through the terminal device, but
instead directly into the memory-mapped framebuffer (see **mmap(2)**). Bytes
used for framebuffer graphics are thus independent of bytes written to the
terminal. This explains why **sprixelbytes** may be surprising given the
value of **render_bytes**.
value of **raster_bytes**.

# RETURN VALUES

Expand Down
25 changes: 11 additions & 14 deletions include/notcurses/notcurses.h
Original file line number Diff line number Diff line change
Expand Up @@ -1505,13 +1505,15 @@ typedef struct ncstats {
uint64_t writeouts; // successful ncpile_rasterize() runs
uint64_t failed_renders; // aborted renders, should be 0
uint64_t failed_writeouts; // aborted writes
// FIXME these next three all ought be "writeout" or "raster"
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 raster_bytes; // bytes emitted to ttyfp
int64_t raster_max_bytes; // max bytes emitted for a frame
int64_t raster_min_bytes; // min bytes emitted for a frame
uint64_t render_ns; // nanoseconds spent rendering
int64_t render_max_ns; // max ns spent in render for a frame
int64_t render_min_ns; // min ns spent in render for a frame
uint64_t raster_ns; // nanoseconds spent rasterizing
int64_t raster_max_ns; // max ns spent in raster for a frame
int64_t raster_min_ns; // min ns spent in raster for a frame
uint64_t writeout_ns; // nanoseconds spent writing frames to terminal
int64_t writeout_max_ns; // max ns spent writing out a frame
int64_t writeout_min_ns; // min ns spent writing out a frame
Expand All @@ -1524,21 +1526,16 @@ typedef struct ncstats {
uint64_t defaultelisions; // default color was emitted
uint64_t defaultemissions; // default color was elided
uint64_t refreshes; // refresh requests (non-optimized redraw)
uint64_t appsync_updates; // how many application-synchronized updates?

// current state -- these can decrease
uint64_t fbbytes; // total bytes devoted to all active framebuffers
unsigned planes; // number of planes currently in existence

// FIXME placed here for ABI compatibility; move up for ABI3
uint64_t raster_ns; // nanoseconds spent rasterizing
int64_t raster_max_ns; // max ns spent in raster for a frame
int64_t raster_min_ns; // min ns spent in raster for a frame
uint64_t sprixelemissions; // sprixel draw count
uint64_t sprixelelisions; // sprixel elision count
uint64_t sprixelbytes; // sprixel bytes emitted
uint64_t appsync_updates; // how many application-synchronized updates?
uint64_t input_errors; // errors processing control sequences/utf8
uint64_t input_events; // characters returned to userspace

// current state -- these can decrease
uint64_t fbbytes; // total bytes devoted to all active framebuffers
unsigned planes; // number of planes currently in existence
} ncstats;

// Allocate an ncstats object. Use this rather than allocating your own, since
Expand Down

0 comments on commit 021a6ea

Please sign in to comment.