closing banner: show ASUs as percentage of total writeouts

This commit is contained in:
nick black 2021-06-23 16:36:18 -04:00
parent f042135c5a
commit dc08fea378
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -219,10 +219,11 @@ void summarize_stats(notcurses* nc){
(stats->bgelisions * 100.0) / (stats->bgemissions + stats->bgelisions));
char totalbuf[BPREFIXSTRLEN + 1];
qprefix(stats->sprixelbytes, 1, totalbuf, 1);
fprintf(stderr, "Sprixel emits:elides: %ju:%ju (%.2f%%) %sB ASUs: %ju\n",
fprintf(stderr, "Sprixel emits:elides: %ju:%ju (%.2f%%) %sB ASUs: %ju (%.2f%%)\n",
stats->sprixelemissions, stats->sprixelelisions,
(stats->sprixelemissions + stats->sprixelelisions) == 0 ? 0 :
(stats->sprixelelisions * 100.0) / (stats->sprixelemissions + stats->sprixelelisions),
totalbuf, stats->appsync_updates);
totalbuf, stats->appsync_updates,
stats->writeouts ? stats->appsync_updates * 100.0 / stats->writeouts : 0);
}
}