mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
[stats] add new cell_geo_changes and pixel_geo_changes stats #2384
This commit is contained in:
parent
80dd726239
commit
8d84c79296
@ -45,6 +45,8 @@ typedef struct ncstats {
|
||||
uint64_t input_events; // inputs received or synthesized
|
||||
uint64_t input_errors; // errors processing input
|
||||
uint64_t hpa_gratuitous; // gratuitous HPAs issued
|
||||
uint64_t cell_geo_changes; // cell geometry changes (resizes)
|
||||
uint64_t pixel_geo_changes;// pixel geometry changes (font resize)
|
||||
|
||||
// current state -- these can decrease
|
||||
uint64_t fbbytes; // bytes devoted to framebuffers
|
||||
@ -127,6 +129,14 @@ is not even generally possible to know how many glyphs will result from a
|
||||
sequence of EGCs. As a result, Notcurses sometimes issues "gratuitous" **hpa**
|
||||
controls.
|
||||
|
||||
**cell_geo_changes** is the number of changes to the visible area's cell
|
||||
geometry. The cell geometry changes whenever the visible area is resized
|
||||
without a corresponding cell-pixel geometry change. **pixel_geo_changes**
|
||||
is the number of changes to cells' pixel geometry (i.e. the height and
|
||||
width of each cell), and changes whenever the font size changes. Both can
|
||||
change at the same time if e.g. a terminal undergoes a font size change
|
||||
without changing its total size.
|
||||
|
||||
# NOTES
|
||||
|
||||
Unsuccessful render operations do not contribute to the render timing stats.
|
||||
@ -141,7 +151,7 @@ value of **raster_bytes**.
|
||||
|
||||
Neither **notcurses_stats** nor **notcurses_stats_reset** can fail. Neither
|
||||
returns any value. **notcurses_stats_alloc** returns a valid **ncstats**
|
||||
object on success, or **NULL** on failure.
|
||||
object on success, or **NULL** on allocation failure.
|
||||
|
||||
# SEE ALSO
|
||||
|
||||
|
@ -1590,6 +1590,8 @@ typedef struct ncstats {
|
||||
uint64_t input_errors; // errors processing control sequences/utf8
|
||||
uint64_t input_events; // characters returned to userspace
|
||||
uint64_t hpa_gratuitous; // unnecessary hpas issued
|
||||
uint64_t cell_geo_changes; // cell geometry changes (resizes)
|
||||
uint64_t pixel_geo_changes;// pixel geometry changes (font resize)
|
||||
|
||||
// current state -- these can decrease
|
||||
uint64_t fbbytes; // total bytes devoted to all active framebuffers
|
||||
|
@ -153,6 +153,8 @@ void notcurses_stats_reset(notcurses* nc, ncstats* stats){
|
||||
stash->input_errors += nc->stats.s.input_errors;
|
||||
stash->input_events += nc->stats.s.input_events;
|
||||
stash->hpa_gratuitous += nc->stats.s.hpa_gratuitous;
|
||||
stash->cell_geo_changes += nc->stats.s.cell_geo_changes;
|
||||
stash->pixel_geo_changes += nc->stats.s.pixel_geo_changes;
|
||||
|
||||
stash->fbbytes = nc->stats.s.fbbytes;
|
||||
stash->planes = nc->stats.s.planes;
|
||||
@ -243,4 +245,8 @@ void summarize_stats(notcurses* nc){
|
||||
stats->raster_bytes ? (stats->sprixelbytes * 100.0) / stats->raster_bytes : 0,
|
||||
stats->appsync_updates,
|
||||
stats->writeouts ? stats->appsync_updates * 100.0 / stats->writeouts : 0);
|
||||
if(stats->cell_geo_changes || stats->pixel_geo_changes){
|
||||
fprintf(stderr,"%sScreen/cell geometry changes: %"PRIu64"/%"PRIu64 NL,
|
||||
clreol, stats->cell_geo_changes, stats->pixel_geo_changes);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user