summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2024-10-06 23:53:31 -0700
committerVito Caputo <vcaputo@pengaru.com>2024-10-08 01:31:31 -0700
commitd8c4ef925d76ee086b0b47b4b43a4535d5f5f4b9 (patch)
tree09a96d0f058379a3e12971d5b06321f08ff9a631 /src
parent1738fc1ed24e9d8787e6fce9a12b3654409f3615 (diff)
charts: introduce a scheduling "adherence" row
This draws the new scheduling "adherence" metric in a row below the top IOWait/Idle% row. The headings have moved down one to cover "adherence" instead, which I think should help make the important IOWait/Idle% row more visible as well as improving headings readability. The adherence row should generally be either black or red, rarely cyan. Red indicates %age of sampling interval behind schedule for the given sample, Cyan indicates same but ahead of schedule which should be unusual/almost never happen. Infact I think the current sharing of the "close enough" epsilon as adherence truncating threshold the ahead of schedule "close enough" situations will always get truncated to zero. So it might be impossible to see any cyan adherence as-is right now. A future commit will move the '\/\/\ # %name @ Hz' heading up to the IOWait/Idle% putting it back in the upper right corner, but only that one.
Diffstat (limited to 'src')
-rw-r--r--src/charts.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/charts.c b/src/charts.c
index 35eab50..5767b8f 100644
--- a/src/charts.c
+++ b/src/charts.c
@@ -47,7 +47,7 @@
#define CHART_VMON_SYS_WANTS (VMON_WANT_SYS_STAT)
#define CHART_MAX_COLUMNS 16
#define CHART_DELTA_SECONDS_EPSILON .001f /* adherence errors smaller than this are treated as zero */
-#define CHART_NUM_FIXED_HEADER_ROWS 1 /* number of rows @ top before the hierarchy */
+#define CHART_NUM_FIXED_HEADER_ROWS 2 /* number of rows @ top before the hierarchy */
/* the global charts state, supplied to vwm_chart_create() which keeps a reference for future use. */
typedef struct _vwm_charts_t {
@@ -986,14 +986,16 @@ static void draw_chart(vwm_charts_t *charts, vwm_chart_t *chart, vmon_proc_t *pr
int row = 0, depth = 0;
/* IOWait and Idle % @ row 0 */
- draw_bars(charts, chart, 0, 1.0, charts->iowait_delta, charts->total_delta, charts->idle_delta, charts->total_delta);
+ draw_bars(charts, chart, row, 1.0, charts->iowait_delta, charts->total_delta, charts->idle_delta, charts->total_delta);
+ /* "adherence" @ row 1 */
+ draw_bars(charts, chart, row + 1, 1.0, charts->this_sample_adherence > 0.f ? charts->this_sample_adherence : 0.f /* a_fraction */, 1.f /* a_total */, charts->this_sample_adherence < 0.f ? -charts->this_sample_adherence : 0.f /* b_fraction */, /* b_total */ 1.f);
- /* only draw the \/\/\ and HZ if necessary */
+ /* only draw the column headings, \/\/\ and HZ if necessary */
if (sample_duration_idx == (charts->this_sample_duration - 1)) {
if (deferred_pass || (!charts->defer_maintenance && (chart->redraw_needed || charts->prev_sampling_interval_secs != charts->sampling_interval_secs))) {
- vcr_clear_row(chart->vcr, VCR_LAYER_TEXT, row, -1, -1);
- draw_columns(charts, chart, chart->columns, 1 /* heading */, 0 /* depth */, row, proc);
- shadow_row(charts, chart, row);
+ vcr_clear_row(chart->vcr, VCR_LAYER_TEXT, row + 1, -1, -1);
+ draw_columns(charts, chart, chart->columns, 1 /* heading */, 0 /* depth */, row + 1, proc);
+ shadow_row(charts, chart, row + 1);
}
if (!prev_redraw_needed)
© All Rights Reserved