summaryrefslogtreecommitdiff
path: root/src/vmon.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2024-07-27 14:56:03 -0700
committerVito Caputo <vcaputo@pengaru.com>2024-08-13 23:36:51 -0700
commit77fe3c826652b0697359c65ead688f4f4bf4a742 (patch)
tree8d36434d0c09148ae665da61a00f582d7f3822b0 /src/vmon.c
parent9b05c41168842035ddcd377ed5e23bb862fb4a60 (diff)
charts: experimenting with a deferred maintenance mode
Diffstat (limited to 'src/vmon.c')
-rw-r--r--src/vmon.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/vmon.c b/src/vmon.c
index 7eac119..a3067f5 100644
--- a/src/vmon.c
+++ b/src/vmon.c
@@ -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)
© All Rights Reserved