diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2024-07-27 14:56:03 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2024-08-13 23:36:51 -0700 |
commit | 77fe3c826652b0697359c65ead688f4f4bf4a742 (patch) | |
tree | 8d36434d0c09148ae665da61a00f582d7f3822b0 /src/vmon.c | |
parent | 9b05c41168842035ddcd377ed5e23bb862fb4a60 (diff) |
charts: experimenting with a deferred maintenance mode
Diffstat (limited to 'src/vmon.c')
-rw-r--r-- | src/vmon.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -590,7 +590,7 @@ static vmon_t * vmon_startup(int argc, const char * const *argv) goto _err_free; } - vmon->charts = vwm_charts_create(vmon->vcr_backend); + vmon->charts = vwm_charts_create(vmon->vcr_backend, VWM_CHARTS_FLAG_DEFER_MAINTENANCE); if (!vmon->charts) { VWM_ERROR("unable to create charts instance"); goto _err_vcr; @@ -745,6 +745,9 @@ static int vmon_snapshot(vmon_t *vmon) return -ENOMEM; } + if (vmon->headless) + vwm_chart_compose(vmon->charts, vmon->chart); + /* FIXME: render/libpng errors need to propagate and be handled */ vwm_chart_render(vmon->charts, vmon->chart, VCR_PRESENT_OP_SRC, png_dest, -1, -1, -1, -1); png_dest = vcr_dest_free(png_dest); @@ -816,9 +819,10 @@ int main(int argc, const char * const *argv) * if 0 is returned, no update was performed/no changes occured. */ if (vwm_charts_update(vmon->charts, &delay)) { - vwm_chart_compose(vmon->charts, vmon->chart); - if (!vmon->headless) + if (!vmon->headless) { + vwm_chart_compose(vmon->charts, vmon->chart); vwm_chart_render(vmon->charts, vmon->chart, VCR_PRESENT_OP_SRC, vmon->vcr_dest, -1, -1, -1, -1); + } } if (vcr_backend_poll(vmon->vcr_backend, delay) > 0) |