From 1123184e5092aabe12b50ffb356213a74a26862f Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 19 Oct 2024 16:13:55 -0700 Subject: charts: stub out marker API This introduces the concept of border markers intended to serve as timeline references/milestones. Here only the minimal API for setting their distance is added, nothing is actually implemented yet. --- src/charts.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/charts.c') diff --git a/src/charts.c b/src/charts.c index 8001526..9d31603 100644 --- a/src/charts.c +++ b/src/charts.c @@ -65,6 +65,7 @@ typedef struct _vwm_charts_t { vmon_t vmon; float prev_sampling_interval_secs, sampling_interval_secs; int sampling_paused, contiguous_drops, primed; + unsigned marker_distance; float inv_ticks_per_sec, inv_total_delta; unsigned defer_maintenance:1; } vwm_charts_t; @@ -1300,6 +1301,15 @@ void vwm_charts_rate_set(vwm_charts_t *charts, unsigned hertz) } +/* set an arbitrary marker spacing in pixels, 0 disables markers (default) */ +void vwm_charts_marker_distance_set(vwm_charts_t *charts, unsigned distance) +{ + assert(charts); + + charts->marker_distance = distance; +} + + /* convenience function for returning the time delta as a seconds.fraction float */ static float delta(struct timespec *cur, struct timespec *prev) { -- cgit v1.2.3