Timing Waterfall
Request timing waterfall web component: one stacked bar and a legend showing where a request's time went (DNS, connect, waiting, download).
- 2.9 KB gzipped
- @lit-material/timing-waterfall 1.8.0
- Renders on the server
Example
Timing waterfall
Where a request's time went: DNS, connect, waiting for the first byte and download, as one bar and a legend.
A new connection
- DNS 4 ms
- Connect 30 ms
- Waiting 96 ms
- Download 12 ms
- Total 142 ms
A reused connection
- DNS 0 ms
- Connect 0 ms
- Waiting 20 ms
- Download 1 ms
- Total 21 ms
- Reused connection
Your own phases
- Queued 40 ms
- Build 820 ms
- Upload 160 ms
- Total 1,020 ms
Install
npm install @lit-material/timing-waterfall @lit-material/tokens
import "@lit-material/timing-waterfall";
Link @lit-material/tokens/css/index.css once per page for the colour, type and shape tokens. Install guide
API
<lit-material-timing-waterfall>
Where a request's time went: one stacked bar, a segment per phase in proportion to its
time, and a legend with each phase's milliseconds and the total. Give it timings (DNS,
connect, waiting, download — a reused connection says so) or your own phases.
Properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
timings | timings | RequestTimings | null | null | DNS, connect, waiting and download times (HITOP's report shape). |
phases | phases | TimingPhase[] | [] | Your own phases instead of timings. |
hideLegend | hide-legend | boolean | false | Hide the legend and show the bar only. |
CSS parts
| Part | Description |
|---|---|
bar | The bar. |
segment | Each segment. |
legend | The legend. |
CSS custom properties
| Property | Description |
|---|---|
--lit-material-timing-waterfall-dns | The DNS segment's colour. |
--lit-material-timing-waterfall-connect | The connect segment's colour. |
--lit-material-timing-waterfall-wait | The waiting segment's colour. |
--lit-material-timing-waterfall-download | The download segment's colour. |
--lit-material-timing-waterfall-track | The bar's background (default: surface container). |
--lit-material-timing-waterfall-height | The bar's height (default 8px). |