From 60f5e8a2108fb00a3674091dce917cbb94a6715f Mon Sep 17 00:00:00 2001 From: nick black Date: Tue, 20 Apr 2021 01:34:16 -0400 Subject: [PATCH] stats: don't post failed_renders from update_render_bytes --- src/lib/stats.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/stats.c b/src/lib/stats.c index b80d88fb9..ed4ca7c28 100644 --- a/src/lib/stats.c +++ b/src/lib/stats.c @@ -20,7 +20,9 @@ void update_write_stats(const struct timespec* time1, const struct timespec* tim } } -// negative 'bytes' is recorded as a failure. call only while holding statlock. +// negative 'bytes' are ignored as failures. call only while holding statlock. +// we don't increment failed_renders here because 'bytes' < 0 actually indicates +// a rasterization failure -- we can't fail in rendering anymore. void update_render_bytes(ncstats* stats, int bytes){ if(bytes >= 0){ stats->render_bytes += bytes; @@ -30,8 +32,6 @@ void update_render_bytes(ncstats* stats, int bytes){ if(bytes < stats->render_min_bytes){ stats->render_min_bytes = bytes; } - }else{ - ++stats->failed_renders; } } @@ -184,7 +184,7 @@ void summarize_stats(notcurses* nc){ totalbuf, minbuf, avgbuf, maxbuf); } if(stats->renders || stats->failed_renders){ - fprintf(stderr, "%ju failed render%s, %ju failed write%s, %ju refresh%s\n", + fprintf(stderr, "%ju failed render%s, %ju failed rasters%s, %ju refresh%s\n", stats->failed_renders, stats->failed_renders == 1 ? "" : "s", stats->failed_writeouts,