v0.1.0 · for Native Shell 0.6+ · Apache-2.0

Time-series charts that stay fast at 10 million points.

Observability charts for Native Shell: a TSX TimeSeriesChart with an opt-in Rust backend, and logs, trace waterfalls, flame graphs and latency heatmaps beside it. Live metrics, zoom, synced panels, thresholds and deploy markers, drawn on NSH's native canvas on iOS, Android, desktop and the web.

Open the live demo → Benchmarks nsh add nsh-o11y
3.5 msa full-view frame of 10M points
50–65×faster than uPlot, ECharts, Chart.js at 10M
0.4 msa live frame, 1M points kept
0one-sample spikes dropped
example/App.tsx · running on NSH's web runtime
Full screen ↗
Loading the NSH runtime…
Drag to zoom to a range · Shift-drag pans Scroll or pinch to zoom · double-click resets ←→ step the cursor · Backspace back · 0 reset Click a legend entry to hide a series Tabs: Logs, Traces, Profiles · Latency → Heatmap

Built for dashboards that never stop

A frame costs what the plot's width does, not what the data does. Everything else an O11y panel needs comes with it.

Level of detail, exactly

Each series keeps a min/max pyramid. A frame takes the first, min, max and last of each pixel column (M4), so a spike one sample wide in ten million is still drawn.

Opt-in Rust backend

Register it and samples live in Rust: they cross once, when appended, and each frame one SVG path per series comes back. Past NSH's 256 MB JS heap, to hundreds of millions of samples.

Live data

append one sample or a batch. maxPoints keeps a window by shifting the pyramid, not rebuilding it; window shows the last N minutes and follows.

Made for O11y

Units (reqps, ms, bytes, percent…), calendar-aware time axes, SLO thresholds, deploy and incident annotations, gaps, steps and fills.

Synced panels

createChartSync() shares the crosshair and the zoom across every chart on the page. Two canvases per chart: moving the pointer never redraws the data.

Accessible, headless, exportable

Keyboard navigation, a screen-reader label with every value at the cursor, PNG export. The store, engine and renderer are plain TypeScript you can run without the view.

Logs, traces and profiles, too

The other signals on the same canvases and the same theme, linked to each other: a log line opens its trace, a heatmap cell opens a request in it. The demo's tabs show each one.

LogView

Level toggles with counts, search, a stacked volume histogram to drag a time range on, and a virtualized list. Live frames don't rescan: 13 ms at 50,000 lines in NSH's interpreter.

TraceWaterfall

Spans as a tree of bars by service, errors outlined, the critical path underlined, span events marked. An overview to brush a range on; only the rows in view are drawn, at any trace size.

FlameGraph

Zoom to a frame, search, walk it from the keyboard. Pass a baseline for a diff (red grew, blue shrank), or open a function in a SandwichView, between its callers and callees.

Heatmap

A latency distribution over time with percentile lines: a slow minority shows as its own band where p99 just rises. Exemplars link cells to traces; hours of data sum into columns that fit the screen.

A few lines of TSX

Make a store, append to it, hand it to the chart.

  • Any data source. A store from createTimeSeries, or plain arrays: { x, ys }. NaN is a gap.
  • Reactive controller. range(), following() and cursor() are signals; setRange, zoom, back, toImage.
  • Rust when you need it. One call to setNativeBackend; every store after it lives in Rust, and apps without Rust keep working.
  • Follows your theme. Colors come from NSH theme tokens, light and dark, or override any of them.
  • Draws the same everywhere. Rust and TypeScript trace identical paths; the tests check it.
import { mount } from "nsh";
import { TimeSeriesChart, createChartSync,
         createTimeSeries } from "nsh-o11y";

const latency = createTimeSeries({ series: 3, maxPoints: 100_000 });
setInterval(() =>
  latency.append(Date.now(), [p50(), p95(), p99()]), 1000);

function App() {
  const sync = createChartSync();
  return (
    <TimeSeriesChart
      title="Latency"
      data={latency}
      series={[{ label: "p50" }, { label: "p95" }, { label: "p99" }]}
      unit="ms"
      window={15 * 60_000}            // the last 15 min, live
      thresholds={[{ value: 250, label: "SLO" }]}
      annotations={[{ time: deployedAt, label: "deploy v2.14" }]}
      sync={sync}
      style={{ flex: 1 }}
    />
  );
}

mount(App);

Faster than the charts you know

The same data, the same 1000 × 300 plot, each library set up as its docs recommend for big series, each in a fresh headless Edge. nsh-o11y runs its own TypeScript engine on the same page, so the comparison is like for like. JavaScript time per frame; lower is better.

Full-view frame

The whole series on screen, recomputed, as a pan, a resize or new data needs.

Plotly (scattergl) draws on the GPU, which isn't in JavaScript time: once its upload is done (14 s at 10M), a frame mostly moves a camera: 18.7, 18 and 14.5 ms.

Live and dashboards

Live: 1M samples kept, 3000 in view, one appended per frame. Dashboard: 24 panels × 3 series × 20k, all redrawn.

LibraryLiveDashboard
nsh-o11y0.41 ms31 ms
uPlot0.43 ms75 ms
Dygraphs46 ms531 ms
Chart.js124 ms176 ms
ECharts1073 ms152 ms
Plotly1785 msn/a¹

ECharts, Chart.js and Plotly re-ingest the whole dataset on each update. ¹ Browsers keep about 16 WebGL contexts.

Zooming in

A wheel zoom, 1.25× a frame, toward the middle.

Library1M10M
nsh-o11y2.1 ms2.4 ms
uPlot6.1 ms28.5 ms
ECharts24 ms143 ms
Chart.js57 ms27 ms
Plotly35 ms55 ms
Dygraphs81 ms2862 ms

Creating the chart with its first draw, 10M samples: nsh-o11y 246 ms, uPlot 268, Chart.js 335, ECharts 628.

Inside NSH: TypeScript or Rust

NSH runs TSX on QuickJS, an interpreter, everywhere but the web. The Rust store does the per-sample work natively and brings an NSH app to browser speed or better. Measured with nsh test perf.

SamplesTypeScript, full viewRust, full viewRust, zoomingRust, load
100,00014.2 ms1.8 ms0.84 ms6.6 ms
1,000,00020.2 ms2.6 ms1.0 ms79 ms
10,000,000out of memory²4.4 ms3.2 ms1277 ms

² NSH caps the JS heap at 256 MB, so the TypeScript store holds about 2 million samples. Live (1M kept): 2.1 ms TypeScript, 0.94 ms Rust. 24-panel dashboard: 491 ms TypeScript, 46 ms Rust. Method and every figure: bench/README.md.

How it compares

Browser chart libraries need a DOM, so none of them run inside an NSH app off the web. nsh-o11y is built for it, and holds its own in the browser too.

nsh-o11yuPlotEChartsChart.jsPlotly
Runs inside NSH✓ iOS · Android · desktop · web✕ DOM✕ DOM✕ DOM✕ DOM, WebGL
Big seriesmin/max pyramid + M4: cost follows the widthdraws every point in viewLTTB sampling over the points in viewmin-max decimation over the points in viewWebGL
Spikes one sample wide✓ always drawn✓ drawncan be sampled away✓ kept✓ drawn
Live, 1M kept0.41 ms a frame0.43 ms1073 ms124 ms1785 ms
O11y built inunits, thresholds, annotations, synced panels, follow windowsync; the rest by pluginsmarkLine / markArea, connectby pluginsshapes, annotations
Accessibilitykeyboard, screen-reader label, values at the cursornone built inaria descriptionnone built innone built in
Chart typestime series, latency heatmap, log volume, trace waterfall, flame graph (diff, sandwich)time series, barsdozensmanydozens

Honest gaps: no bars or stacked areas yet, and with only a few thousand points on screen uPlot ties it. See the roadmap.

Put a dashboard in your NSH app

Requires NSH 0.7 or later. nsh add nsh-o11y installs it from crates.io: the TSX charts and their Rust backend; without Rust it runs on TypeScript alone.