<talos-percentile> draws what latency dashboards live on: p50 / p90 / p99
(and optionally p25 / p75 / p05) of a metric as markers on a horizontal scale. It
is a box plot in HUD clothing. The p99 marker is coloured by band against
warn / crit, because the tail is what pages you: “p99 latency is critical”
reads red before you read the number.
Default — streaming via .stats
<talos-percentile warn="400" crit="700" label="latency" unit="ms" width="460"></talos-percentile>
<script type="module">
const el = document.querySelector("talos-percentile");
el.stats = { p05: 24, p25: 45, p50: 60, p75: 78, p90: 130, p99: 410 };
</script>
The demo re-assigns .stats every second. Markers slide to their new positions
(suppressed under prefers-reduced-motion); with no min / max the scale
auto-fits the supplied percentiles with a little headroom, so p99 is never pinned
to the right edge.
Declarative
<talos-percentile
p25="40" p50="61" p75="88" p90="240" p99="820"
warn="400" crit="700" unit="ms"
></talos-percentile>
Attributes render whichever percentiles are present. The box needs both p25
and p75.
Behaviour
el.stats = { p50, p90, p99, p25?, p75?, p05? } replaces the set and re-renders.
Attributes
Generated from custom-elements.json in the installed package.
Shared attributes (state, format, static…) behave as the
instrument contract describes.
| Attribute | Type | Default | Description |
|---|---|---|---|
p05 | number | — | low whisker end. |
p25 | number | — | interquartile box bounds. |
p50 | number | — | the canonical percentiles (median, tail, far tail) |
p75 | number | — | interquartile box bounds. |
p90 | number | — | the canonical percentiles (median, tail, far tail) |
p99 | number | — | the canonical percentiles (median, tail, far tail) |
min | number | — | scale domain; auto-fit to percentiles when absent. |
max | number | — | scale domain; auto-fit to percentiles when absent. |
warn | number | — | band thresholds, applied to p99 by default. |
crit | number | — | band thresholds, applied to p99 by default. |
invert | boolean | — | low = bad (the band trips as the value falls) |
label | string | — | caption above the rail. |
unit | string | — | appended to the percentile labels. |
width | number | 240 | px. |
format | string | — | number | compact | percent | bytes | duration | currency; the readout's number format |
precision | string | — | fraction digits of the formatted value |
currency | string | — | ISO 4217 code when format=currency |
locale | string | — | BCP 47 locale for formatting; defaults to the page locale |
state | string | — | live | loading | stale | offline | unknown; sets data-state on the host |
updated-at | string | — | time of the last sample (ISO or epoch ms); drives the age caption |
stale-after | string | — | seconds after updated-at at which the element reads stale |
static | string | — | boolean; turns motion off for this element only |
duration | number | — | transition length in ms |
Properties and methods
| Member | Type | Description |
|---|---|---|
.stats | PercentileStats | null |
Events
| Event | Type | Description |
|---|---|---|
talos:band | CustomEvent<BandEventDetail> | Fired when the band changes (not on first render): detail { from, to, value }. Bubbles and is composed. |
CSS parts
::part(box), ::part(caption), ::part(marks), ::part(rail), ::part(svg), ::part(whiskers)