Event contract
Fields the query expects
| Field | Type | Why it exists |
|---|---|---|
| timestamp_utc | Timestamp | Task completion time. |
| route_template | Utf8 | Stable page route. |
| release | Utf8 | Frontend build identifier. |
| duration_ms | Float64 | Observed main-thread task duration. |
| interaction_related | Boolean | Whether the task overlapped a measured interaction. |
Copy the query
SELECT
route_template,
release,
COUNT(*) AS observed_tasks,
SUM(CASE WHEN duration_ms > 50 THEN 1 ELSE 0 END) AS long_tasks,
SUM(CASE WHEN duration_ms > 50 THEN duration_ms - 50 ELSE 0 END)
AS blocked_time_ms,
100.0 * SUM(CASE WHEN duration_ms > 50 THEN 1 ELSE 0 END)
/ NULLIF(COUNT(*), 0) AS long_task_rate_pct
FROM browser_task_events
WHERE timestamp_utc >= now() - INTERVAL '7 days'
GROUP BY route_template, release
ORDER BY blocked_time_ms DESC;This read-only query is planned and executed against an empty typed table with Apache DataFusion 45.2.0. The deterministic sample output is synthetic and reviewed separately; validate field types, thresholds, and business definitions against your own data. Read the testing methodology.
Query result
Blocked main-thread time by route
The editor creates more than twice the blocked time despite fewer observed tasks.
| route_template | release | observed_tasks | long_tasks | blocked_time_ms | long_task_rate_pct |
|---|---|---|---|---|---|
| /editor | web-103 | 9,200 | 644 | 52,180 | 7 |
| /dashboard | web-103 | 15,400 | 462 | 23,860 | 3 |
Synthetic example output. Run the query against your own event schema and thresholds before using it for operational decisions.
Reproduce the example
Download the public fixture
The JSON bundle includes the typed event contract, illustrative input rows, exact SQL, expected output, review notes, and engine version. The CSV contains the displayed result.
How the SQL works
- 1The 50 ms boundary follows the browser long-task convention.
- 2Blocked time subtracts the allowable first 50 ms so severity is additive.
- 3Release grouping supports before-and-after review.
Edge cases to decide
- Browser support and sampling rates must be documented.
- Background-tab work can be misleading.
- Long tasks indicate blocking but do not identify the responsible function without complementary profiling.
Recommended dashboard
- Bars: blocked_time_ms by route
- Trend: long_task_rate_pct by release
- Table: interaction-related long tasks
Alert guidance
Review sustained blocked-time regressions after a release; page only when tied to a critical workflow.
Read alert setupPut the recipe to work
Related instrumentation and guides
Continue the analysis
Compare Core Web Vitals by Route and Release
Compare LCP, INP, and CLS samples by stable route and release while keeping the percentage of passing samples visible.
Open recipeRank JavaScript Errors by Route and Release
Find frontend releases and routes with the most repeated JavaScript failures and affected sessions.
Open recipeMeasure SPA Navigation Latency by Route
Compare typical and tail client-side navigation time by destination route and frontend release.
Open recipeRun it on real events
Create a table, adapt the fields, and save the result
Start free, send structured events, and use the query result as a chart, shared dashboard widget, or alert input.