Book a callGitHub224

Latency p95

settle-api · last 24 hours

Now
547 ms

Above its 450 ms objective since 13:21View alert

TodayYesterdayObjectiveNo dataDeploy

Live preview: try it.

Source
<!-- Icons: Lucide (lucide.dev), ISC licence -->
<style>
.odl-service-health { box-sizing: border-box; inline-size: 100%; max-inline-size: 38rem; margin-inline: auto; container-type: inline-size; color: var(--ds-color-text-primary); font: var(--ds-text-body-md); text-wrap: pretty; }
.odl-service-health *, .odl-service-health *::before { box-sizing: border-box; }
.odl-service-health .odl-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ds-space-stack-lg); padding: var(--ds-space-inset-xl); background: var(--ds-color-surface-raised);
  border: var(--ds-border-width-default) solid var(--ds-color-border-subtle); border-radius: var(--ds-radius-container); box-shadow: var(--ds-elevation-raised); }
.odl-service-health .odl-icon { flex: none; inline-size: var(--ds-size-icon-sm); block-size: var(--ds-size-icon-sm); fill: none; stroke: currentColor; stroke-width: var(--ds-icon-stroke-md); }
.odl-service-health header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: var(--ds-space-stack-sm) var(--ds-space-inset-xl); }
.odl-service-health h3 { margin: 0; font: var(--ds-text-title-md); }
.odl-service-health .odl-meta { margin: var(--ds-space-stack-xs) 0 0; color: var(--ds-color-text-secondary); font: var(--ds-text-label-md); }
.odl-service-health .odl-now { display: grid; justify-items: end; gap: var(--ds-space-stack-xs); margin: 0; }
.odl-service-health .odl-now dt { color: var(--ds-color-text-secondary); font: var(--ds-text-label-md); }
.odl-service-health .odl-now dd { margin: 0; color: var(--ds-color-text-warning); font: var(--ds-text-title-lg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.odl-service-health .odl-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ds-space-stack-xs) var(--ds-space-inline-md); margin: 0;
  padding: var(--ds-space-inset-xs) var(--ds-space-inset-xs) var(--ds-space-inset-xs) var(--ds-space-inset-sm); border-radius: var(--ds-radius-nested); background: var(--ds-color-bg-warning-subtle); }
.odl-service-health .odl-status > span { display: inline-flex; align-items: center; gap: var(--ds-space-inline-sm); }
.odl-service-health .odl-status > span .odl-icon { color: var(--ds-color-text-warning); }
.odl-service-health .odl-status a { padding-inline: var(--ds-space-inset-xs); border-radius: var(--ds-radius-control); }
.odl-service-health figure { min-inline-size: 0; margin: 0; }
.odl-service-health .odl-plot { position: relative; margin-block-start: var(--ds-space-stack-lg); }
.odl-service-health .odl-plot svg { display: block; inline-size: 100%; block-size: 15rem; overflow: visible; }
/* Labels and markers sit over the stretched chart in HTML, so they keep their shape at any width. */
.odl-service-health .odl-pin { position: absolute; color: var(--ds-color-text-tertiary); font: var(--ds-text-label-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.odl-service-health .odl-pin.is-max { inset-block-start: 0; inset-inline-start: 0; transform: translateY(-100%); padding-block-end: var(--ds-space-2); }
.odl-service-health .odl-pin.is-obj { inset-block-start: 37.5%; inset-inline-start: 0; transform: translateY(-100%); padding-block-end: var(--ds-space-2); color: var(--ds-color-text-warning); }
.odl-service-health .odl-end { position: absolute; inset-inline-start: 100%; inset-block-start: 21.67%; inline-size: var(--ds-space-8); block-size: var(--ds-space-8); transform: translate(-50%, -50%);
  border: var(--ds-border-width-emphasis) solid var(--ds-color-text-warning); border-radius: var(--ds-radius-full); background: var(--ds-color-surface-raised);
  box-shadow: 0 0 0 var(--ds-space-2) var(--ds-color-bg-warning-subtle); }
.odl-service-health .odl-dep { position: absolute; inset-inline-start: 87.33%; inset-block-start: 0; inline-size: var(--ds-space-8); block-size: var(--ds-space-8); transform: translate(-50%, -50%) rotate(45deg);
  border-radius: var(--ds-radius-2); background: var(--ds-color-icon-default); }
.odl-service-health .odl-grid { stroke: var(--ds-color-border-separator); }
.odl-service-health .odl-objective { stroke: var(--ds-color-text-warning); stroke-dasharray: 4 3; }
.odl-service-health .odl-prev { stroke: var(--ds-color-border-strong); stroke-dasharray: 2 3; fill: none; }
.odl-service-health .odl-line { stroke: var(--ds-color-text-primary); fill: none; stroke-linejoin: round; }
.odl-service-health .odl-hot { stroke: var(--ds-color-text-warning); }
.odl-service-health [hidden] { display: none !important; }
.odl-service-health .odl-gap { fill: var(--ds-color-bg-neutral-subtle); }
.odl-service-health .odl-deploy { stroke: var(--ds-color-border-strong); stroke-dasharray: 2 3; }
.odl-service-health .odl-plot line, .odl-service-health .odl-plot path, .odl-service-health .odl-plot circle { vector-effect: non-scaling-stroke; stroke-width: 1.5; }
.odl-service-health .odl-axis, .odl-service-health figcaption { display: flex; justify-content: space-between; margin-block-start: var(--ds-space-stack-xs); color: var(--ds-color-text-tertiary); font: var(--ds-text-label-sm); font-variant-numeric: tabular-nums; }
.odl-service-health .odl-axis { position: relative; display: block; block-size: 1lh; }
.odl-service-health .odl-axis span { position: absolute; inset-block-start: 0; inset-inline-start: calc(var(--x) * 1%); transform: translateX(calc(var(--x) * -1%)); white-space: nowrap; }
.odl-service-health figcaption { flex-wrap: wrap; gap: var(--ds-space-stack-xs) var(--ds-space-inset-md); justify-content: start; margin-block-start: var(--ds-space-stack-lg); padding-block-start: var(--ds-space-stack-md);
  border-block-start: var(--ds-border-width-default) solid var(--ds-color-border-subtle); color: var(--ds-color-text-secondary); font: var(--ds-text-label-md); }
.odl-service-health figcaption span { display: inline-flex; align-items: center; gap: var(--ds-space-inline-xs); }
.odl-service-health figcaption i { display: inline-block; inline-size: var(--ds-space-12); border-block-start: var(--ds-border-width-emphasis) solid var(--ds-color-text-primary); }
.odl-service-health figcaption .odl-k-prev { border-block-start-style: dotted; border-color: var(--ds-color-border-strong); }
.odl-service-health figcaption .odl-k-obj { border-block-start-style: dashed; border-color: var(--ds-color-text-warning); }
.odl-service-health figcaption .odl-k-gap { block-size: var(--ds-space-8); border: 0; border-radius: var(--ds-radius-2); background: var(--ds-color-bg-neutral-subtle); }
.odl-service-health figcaption .odl-k-dep { inline-size: var(--ds-space-6); block-size: var(--ds-space-6); margin-inline: var(--ds-space-2); border: 0; border-radius: var(--ds-radius-2); background: var(--ds-color-icon-default); transform: rotate(45deg); }
.odl-service-health a { display: inline-flex; align-items: center; gap: var(--ds-space-inline-xs); min-block-size: var(--ds-size-target-min); color: var(--ds-color-text-link); font: var(--ds-text-label-lg); font-weight: var(--ds-font-weight-label); text-underline-offset: 0.2em; white-space: nowrap; }
.odl-service-health a:hover { text-decoration-thickness: var(--ds-border-width-emphasis); }
.odl-service-health a:focus-visible { outline: var(--ds-focus-ring-width) solid var(--ds-color-border-focus); outline-offset: var(--ds-focus-ring-offset); border-radius: var(--ds-radius-detail); }
@container (max-width: 30rem) {
  .odl-service-health .odl-plot svg { block-size: 13rem; }
  .odl-service-health figcaption { display: grid; grid-template-columns: repeat(3, max-content); gap: var(--ds-space-stack-sm) var(--ds-space-inset-md); }
  .odl-service-health .odl-card { padding: var(--ds-space-inset-lg); }
  .odl-service-health .odl-now { justify-items: start; }
}
</style>
<article class="odl-service-health" aria-label="settle-api latency" data-od-label="service">
  <div class="odl-card">
  <header>
    <div><h3 data-od-slot="title">Latency p95</h3><p class="odl-meta" data-od-optional><span data-od-slot="service" data-od-optional>settle-api</span> · <span data-od-slot="window" data-od-optional>last 24 hours</span></p></div>
    <dl class="odl-now"><dt>Now</dt><dd><span data-od-slot="now">547</span> <span data-od-slot="unit">ms</span></dd></dl>
  </header>
  <p class="odl-status" data-od-optional><span><svg class="odl-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg><span data-od-slot="status">Above its 450 ms objective since 13:21</span></span><a href="#" data-od-action="alert"><span data-od-slot="label">View alert</span><svg class="odl-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></a></p>
  <figure>
    <div class="odl-plot">
    <span class="odl-pin is-max" aria-hidden="true">600 ms</span><span class="odl-pin is-obj" aria-hidden="true">Objective 450 ms</span>
    <svg viewBox="0 0 300 120" preserveAspectRatio="none" role="img" data-od-label="summary" aria-label="p95 latency over the last 24 hours: steady near 380 ms, then rising to 547 ms in the last hour, shortly after deploy v2.41.0">
      <line class="odl-grid" x1="0" y1="0.5" x2="300" y2="0.5"/><line class="odl-grid" x1="0" y1="119.5" x2="300" y2="119.5"/>
      <rect class="odl-gap" x="150" y="1" width="14" height="118"/>
      <line class="odl-objective" x1="0" y1="45" x2="300" y2="45"/>
      <path class="odl-prev" d="M0 95.3 L20 98 L40 99.7 L60 100 L80 96.5 L100 92.2 L120 92 L140 93.9 L160 97.8 L180 99.9 L200 97.9 L220 96.8 L240 95.7 L260 94 L280 94.2 L300 94"/>
      <path class="odl-line" d="M0 70.9 L5 70.9 L10 74.9 L15 72.3 L20 75.9 L25 75.6 L30 74.4 L35 77.6 L40 75.1 L45 77.6 L50 75.4 L55 75.3 L60 77 L65 78.9 L70 74.1 L75 73.9 L80 75.5 L85 76.5 L90 73.3 L95 71.2 L100 73.7 L105 67.2 L110 71.1 L115 66.9 L120 65.3 L125 64.6 L130 65.3 L135 68 L140 64.1 L145 66.5 L150 67.1 M164 65.9 L170 65.9 L175 67.6 L180 71.4 L185 70.9 L190 71.2 L195 73.8 L200 74 L205 73.9 L210 77.7 L215 77.8 L220 75.7 L225 78.1 L230 78 L235 80.2 L240 79.3 L245 76.4 L250 80.2 L255 74.5 L260 75.6 L265 76.9 L270 72.4"/>
      <path class="odl-line odl-hot" d="M270 72.4 L275 66 L280 54.8 L285 50.1 L290 42.2 L295 32.6 L300 26"/>
      <line class="odl-deploy" x1="262" y1="0" x2="262" y2="120"/>
    </svg>
    <span class="odl-dep" aria-hidden="true"></span><span class="odl-end" aria-hidden="true"></span>
    </div>
    <div class="odl-axis" aria-hidden="true" data-od-list="axis"><span data-od-item data-od-template hidden data-od-slot="label"></span><span data-od-item style="--x: 0">14:00</span><span data-od-item style="--x: 25">20:00</span><span data-od-item style="--x: 50">02:00</span><span data-od-item style="--x: 75">08:00</span><span data-od-item style="--x: 100">Now</span></div>
    <figcaption><span><i></i>Today</span><span><i class="odl-k-prev"></i>Yesterday</span><span><i class="odl-k-obj"></i>Objective</span><span><i class="odl-k-gap"></i>No data</span><span><i class="odl-k-dep"></i>Deploy</span></figcaption>
    <div class="odl-data" hidden><data data-od-slot="objective">450</data><data data-od-slot="scale_max">600</data><data data-od-slot="deploy_at">0.873</data>
      <ol data-od-list="series"><li data-od-item data-od-template hidden><data data-od-slot="value"></data></li></ol>
      <ol data-od-list="previous"><li data-od-item data-od-template hidden><data data-od-slot="value"></data></li></ol>
      <ol data-od-list="gaps"><li data-od-item data-od-template hidden><data data-od-slot="from"></data><data data-od-slot="to"></data></li></ol></div>
  </figure>
  </div>
</article>
<script>
// Rendered from data: when the series list holds values, the plot, pins, markers and axis are drawn from them.
document.querySelectorAll(".odl-service-health").forEach((root) => {
  const nums = (list, key = "value") => [...root.querySelectorAll(`[data-od-list="${list}"] > [data-od-item]:not([data-od-template])`)]
    .map((li) => Number(li.querySelector(`[data-od-slot="${key}"]`)?.textContent)).filter((n) => Number.isFinite(n));
  const series = nums("series");
  const key = series.join(",") + "|" + nums("previous").join(",");
  if (series.length < 2 && root.dataset.odComponent) { // rendered with no series yet: an empty plot, never the sample's lines
    root.querySelectorAll(".odl-plot path").forEach((n) => n.removeAttribute("d"));
    root.querySelectorAll(".odl-plot .odl-pin, .odl-plot .odl-dep, .odl-plot .odl-end, .odl-plot .odl-deploy, .odl-plot .odl-objective, .odl-plot .odl-gap").forEach((n) => n.remove());
    return;
  }
  if (series.length < 2 || root.dataset.odlKey === key) return; // the sample drawing stays until data arrives
  root.dataset.odlKey = key;
  const one = (n) => { const t = root.querySelector(`.odl-data [data-od-slot="${n}"]`)?.textContent.trim(); return t === "" || t == null ? null : Number(t); };
  const prev = nums("previous"), obj = one("objective"), dep = one("deploy_at");
  const unit = root.querySelector('.odl-now [data-od-slot="unit"]')?.textContent.trim() || "";
  const max = one("scale_max") || Math.max(...series, ...prev, obj || 0) * 1.1 || 1;
  const W = 300, H = 120, x = (i, n) => (i / (n - 1)) * W, y = (v) => Math.max(1, Math.min(H - 1, H - (v / max) * H));
  const path = (vs) => vs.map((v, i) => `${i ? "L" : "M"}${x(i, vs.length).toFixed(1)} ${y(v).toFixed(1)}`).join(" ");
  const svg = root.querySelector(".odl-plot svg");
  const [line, hot] = svg.querySelectorAll(".odl-line");
  line.setAttribute("d", path(series));
  const hotParts = [];
  if (obj != null) series.forEach((v, i) => { if (i && v > obj && series[i - 1] > obj) hotParts.push(`M${x(i - 1, series.length).toFixed(1)} ${y(series[i - 1]).toFixed(1)} L${x(i, series.length).toFixed(1)} ${y(v).toFixed(1)}`); });
  hot.setAttribute("d", hotParts.join(" "));
  const p = svg.querySelector(".odl-prev");
  if (prev.length > 1) p.setAttribute("d", path(prev)); else p.removeAttribute("d");
  const o = svg.querySelector(".odl-objective"), pinObj = root.querySelector(".odl-pin.is-obj");
  if (obj != null) { o.setAttribute("y1", y(obj)); o.setAttribute("y2", y(obj)); pinObj.style.insetBlockStart = `${(y(obj) / H) * 100}%`; pinObj.textContent = `Objective ${obj} ${unit}`.trim(); }
  else { o.remove(); pinObj.remove(); }
  root.querySelector(".odl-pin.is-max").textContent = `${max} ${unit}`.trim();
  const last = series[series.length - 1];
  root.querySelector(".odl-end").style.insetBlockStart = `${(y(last) / H) * 100}%`;
  const dl = svg.querySelector(".odl-deploy"), dm = root.querySelector(".odl-dep");
  if (dep != null) { dl.setAttribute("x1", dep * W); dl.setAttribute("x2", dep * W); dm.style.insetInlineStart = `${dep * 100}%`; } else { dl.remove(); dm.remove(); }
  const gaps = [...root.querySelectorAll('[data-od-list="gaps"] > [data-od-item]:not([data-od-template])')]
    .map((li) => [Number(li.querySelector('[data-od-slot="from"]')?.textContent), Number(li.querySelector('[data-od-slot="to"]')?.textContent)]);
  const rect = svg.querySelector(".odl-gap");
  gaps.forEach(([a, b], i) => { const r = i ? rect.cloneNode() : rect; r.setAttribute("x", a * W); r.setAttribute("width", Math.max(0, b - a) * W); if (i) rect.after(r); });
  if (!gaps.length) rect.remove();
  const ticks = [...root.querySelectorAll(".odl-axis > span:not([hidden])")];
  ticks.forEach((t, i) => t.style.setProperty("--x", ticks.length > 1 ? String((i / (ticks.length - 1)) * 100) : "0"));
});
</script>

More like this

ConsumerFriendly · Fitness

Daily goals

Today's steps, active minutes and water.

ConsumerFriendly · Personal finance

Savings goal

A savings pot with a cover photo.

B2BQuiet · SaaS

Usage meters

Budget, seats and credit as three meters.

Your kit

Nothing here yet. Add parts with Add to kit, and a look if you want the whole system.

    Parts
    0
    Files to fetch
    0 KB
    Licence
    MIT
    Total
    Free, now and later

    How do you want it?

    Your prompt

    No sign-up. Nothing leaves your browser until you paste it.

    Free