Queue depth matrix

Queue depth measures work waiting to be processed. A matrix separates queues from time buckets, making it possible to see whether a backlog is local to one worker or growing across the system. The screenshot is from Fission's chart gallery.

What the chart is for

A queue count says how much work is waiting, not how long it has waited. Add oldest-job age or processing rate when the user needs to decide whether a backlog is actually worsening.

Data model

The samples contain a time index, queue index and waiting-job count. Decide whether each bucket stores a snapshot, average or maximum before aggregating. The example uses snapshots taken at the labelled times.
HeatmapSeries::data takes Vec<(usize, usize, f32)>. The first two values are category indices; they must refer to the same ordered labels used by the axes.

Rust API

Setting
Type
Meaning
Chart::x_axis
Axis
Supplies the column categories.
Chart::y_axis
Axis
Supplies the row categories, not the cell-value range.
HeatmapSeries::data
Vec<(usize, usize, f32)>
Supplies the indexed cells and their values.
Chart::visual_map
VisualMap
Sets the numeric range used for colour.

Example

use fission::charts::{Axis, Chart, HeatmapSeries, VisualMap};

let chart = Chart::new()
    .title("Queued jobs by queue and time")
    .x_axis(Axis::category(vec!["09:00", "09:15", "09:30"]))
    .y_axis(Axis::category(vec!["Email", "Exports"]))
    .visual_map(VisualMap::new().min(0.0).max(100.0))
    .series(vec![HeatmapSeries::new("Queued jobs")
        .data(vec![
            (0, 0, 8.0),
            (1, 0, 12.0),
            (2, 0, 5.0),
            (0, 1, 21.0),
            (1, 1, 74.0),
            (2, 1, 58.0),
        ])
        .into()]);

Authoring from a Fission component

Pass the prepared samples into the component. Fetching, aggregation and failure handling stay outside the build; the component presents values already available to its parent.
use fission::prelude::*;
use fission::charts::{Axis, Chart, HeatmapSeries, VisualMap};

// The parent resolves display labels from its translation bundles.
fission_component! {
    pub QueueDepthMatrixChart<()> {
        props {
            chart_title: String,
            series_label: String,
            column_labels: Vec<String>,
            row_labels: Vec<String>,
            samples: Vec<(usize, usize, f32)>,
        }
    }
    view(chart, _state, _cx) =>
        Chart(
            title: Some(chart.chart_title.clone()),
            x_axis: Some(Axis::category(
                chart.column_labels.iter().map(String::as_str).collect(),
            )),
            y_axis: Some(Axis::category(
                chart.row_labels.iter().map(String::as_str).collect(),
            )),
            visual_map: Some(VisualMap::new().min(0.0).max(100.0)),
            series: vec![HeatmapSeries::new(&chart.series_label)
                .data(chart.samples.clone())
                .into()],
        )
}

Testing and accessibility

Check an empty queue, a growing queue and a missed snapshot. Do not turn a missed measurement into zero, since that would make a telemetry gap look like a drained queue.
Give the matrix a text summary and an exact-value view when decisions depend on its cells. Inspect the actual rendered width and label lengths; a correctly indexed matrix is still unusable if its category names cannot be read.
Tags: heatmap, queue.