Markus

Metric

metric, the leaf directive for key figures.

A metric is a single key fact. It is a leaf directive: two colons, no body.

Attributes

Attribute Values Default
value any text (required)
unit any text none
label any text Metric
delta any text; sign picks the direction none

Every directive also accepts id, which becomes the HTML id; see Syntax and metadata.

Value only

The label falls back to Metric.

Markus

::metric{value="42"}

Preview

Metric
42

Value and label

Markus

::metric{value="99.95%" label="Uptime"}

Preview

Uptime
99.95%

With unit

Markus

::metric{value="12" unit="ms" label="p95 latency"}

Preview

p95 latency
12ms

Delta direction

The delta text decides the direction: a leading - is down, a leading + is up, anything else is flat.

Negative delta

Markus

::metric{value="12" unit="ms" label="p95 latency" delta="-38%"}

Preview

p95 latency
12ms-38%

Positive delta

Markus

::metric{value="4.2" unit="k" label="Requests per second" delta="+12%"}

Preview

Requests per second
4.2k+12%

Neutral delta

Markus

::metric{value="7" label="Open issues" delta="0%"}

Preview

Open issues
70%

Several in a row

Metrics stack in the document flow; wrap them in a card-grid for a dashboard row.

Markus

::metric{value="12" unit="ms" label="Latency" delta="-38%"}

::metric{value="99.95%" label="Uptime" delta="+0.02%"}

::metric{value="3" label="Regions"}

Preview

Latency
12ms-38%
Uptime
99.95%+0.02%
Regions
3

Metrics in cards

Markus

:::card-grid{columns=3 label="Dashboard"}
:::card{title="Speed"}
::metric{value="12" unit="ms" label="p95" delta="-38%"}
:::

:::card{title="Uptime"}
::metric{value="99.95%" label="30 days" delta="+0.02%"}
:::

:::card{title="Regions"}
::metric{value="3" label="Live"}
:::
:::

Preview

Speed

p95
12ms-38%

Uptime

30 days
99.95%+0.02%

Regions

Live
3