@uptimizr/db 1.0.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/AGENTS.md +103 -1
  2. package/README.md +100 -3
  3. package/dist/cli/createProject.js +23 -6
  4. package/dist/cli/createProject.js.map +1 -1
  5. package/dist/cli/seed.js +12 -4
  6. package/dist/cli/seed.js.map +1 -1
  7. package/dist/duckdb/audit.d.ts +13 -0
  8. package/dist/duckdb/audit.d.ts.map +1 -0
  9. package/dist/duckdb/audit.js +67 -0
  10. package/dist/duckdb/audit.js.map +1 -0
  11. package/dist/duckdb/client.d.ts.map +1 -1
  12. package/dist/duckdb/client.js +4 -0
  13. package/dist/duckdb/client.js.map +1 -1
  14. package/dist/duckdb/migrations.d.ts.map +1 -1
  15. package/dist/duckdb/migrations.js +97 -0
  16. package/dist/duckdb/migrations.js.map +1 -1
  17. package/dist/duckdb/projects.d.ts +9 -5
  18. package/dist/duckdb/projects.d.ts.map +1 -1
  19. package/dist/duckdb/projects.js +54 -24
  20. package/dist/duckdb/projects.js.map +1 -1
  21. package/dist/duckdb/queries.d.ts +7 -0
  22. package/dist/duckdb/queries.d.ts.map +1 -1
  23. package/dist/duckdb/queries.js +10 -1
  24. package/dist/duckdb/queries.js.map +1 -1
  25. package/dist/duckdb/sceneRegions.d.ts +24 -0
  26. package/dist/duckdb/sceneRegions.d.ts.map +1 -0
  27. package/dist/duckdb/sceneRegions.js +72 -0
  28. package/dist/duckdb/sceneRegions.js.map +1 -0
  29. package/dist/index.d.ts +8 -2
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +18 -1
  32. package/dist/index.js.map +1 -1
  33. package/dist/metadata.d.ts +195 -9
  34. package/dist/metadata.d.ts.map +1 -1
  35. package/dist/metadata.js +192 -0
  36. package/dist/metadata.js.map +1 -1
  37. package/dist/parity/compare.d.ts +22 -0
  38. package/dist/parity/compare.d.ts.map +1 -1
  39. package/dist/parity/compare.js +31 -0
  40. package/dist/parity/compare.js.map +1 -1
  41. package/dist/query/aggregations.d.ts +8 -0
  42. package/dist/query/aggregations.d.ts.map +1 -1
  43. package/dist/query/aggregations.js +78 -0
  44. package/dist/query/aggregations.js.map +1 -1
  45. package/dist/query/coerce.d.ts +94 -0
  46. package/dist/query/coerce.d.ts.map +1 -0
  47. package/dist/query/coerce.js +191 -0
  48. package/dist/query/coerce.js.map +1 -0
  49. package/dist/query/summary/cluster.d.ts +78 -0
  50. package/dist/query/summary/cluster.d.ts.map +1 -0
  51. package/dist/query/summary/cluster.js +200 -0
  52. package/dist/query/summary/cluster.js.map +1 -0
  53. package/dist/query/summary/columns.d.ts +66 -0
  54. package/dist/query/summary/columns.d.ts.map +1 -0
  55. package/dist/query/summary/columns.js +98 -0
  56. package/dist/query/summary/columns.js.map +1 -0
  57. package/dist/query/summary/format.d.ts +31 -0
  58. package/dist/query/summary/format.d.ts.map +1 -0
  59. package/dist/query/summary/format.js +119 -0
  60. package/dist/query/summary/format.js.map +1 -0
  61. package/dist/query/summary/index.d.ts +19 -0
  62. package/dist/query/summary/index.d.ts.map +1 -0
  63. package/dist/query/summary/index.js +16 -0
  64. package/dist/query/summary/index.js.map +1 -0
  65. package/dist/query/summary/reading.d.ts +26 -0
  66. package/dist/query/summary/reading.d.ts.map +1 -0
  67. package/dist/query/summary/reading.js +169 -0
  68. package/dist/query/summary/reading.js.map +1 -0
  69. package/dist/query/summary/schema.d.ts +217 -0
  70. package/dist/query/summary/schema.d.ts.map +1 -0
  71. package/dist/query/summary/schema.js +167 -0
  72. package/dist/query/summary/schema.js.map +1 -0
  73. package/dist/query/summary/stats.d.ts +33 -0
  74. package/dist/query/summary/stats.d.ts.map +1 -0
  75. package/dist/query/summary/stats.js +73 -0
  76. package/dist/query/summary/stats.js.map +1 -0
  77. package/dist/query/summary/summarize.d.ts +57 -0
  78. package/dist/query/summary/summarize.d.ts.map +1 -0
  79. package/dist/query/summary/summarize.js +424 -0
  80. package/dist/query/summary/summarize.js.map +1 -0
  81. package/dist/query/summary/types.d.ts +223 -0
  82. package/dist/query/summary/types.d.ts.map +1 -0
  83. package/dist/query/summary/types.js +8 -0
  84. package/dist/query/summary/types.js.map +1 -0
  85. package/dist/query/types.d.ts +13 -0
  86. package/dist/query/types.d.ts.map +1 -1
  87. package/llms.txt +7 -3
  88. package/package.json +10 -4
@@ -8,6 +8,14 @@
8
8
  *
9
9
  * Invariant: no multi-tenant concepts here. Filtering is by `project_id` and the
10
10
  * optional scene/source/session dimensions only.
11
+ *
12
+ * Every builder tags its `QuerySpec` with the registry `metric` id it computes
13
+ * (ADR 0051 §1). That tag is what lets each store's query runner apply numeric
14
+ * coercion at the single point rows leave the driver (`query/coerce.ts`) without
15
+ * the store call sites having to name the metric. The tag and the registry's
16
+ * `builder` field are two halves of one mapping — `src/__tests__/registry.test.ts`
17
+ * fails if they disagree, so a new aggregation still is not done until it has a
18
+ * registry entry.
11
19
  */
12
20
  import { ParamBag, cameraModeClause, dayRangeClause, meshClause, rangeClause, regionClause, sceneClause, sessionClause, sourceClause, } from "./dialect.js";
13
21
  /** World/gaze voxel coordinates derive from the raycast `hit_point` vector. */
@@ -52,6 +60,7 @@ export function buildListSessions(projectId, opts, d) {
52
60
  ORDER BY started_at DESC
53
61
  LIMIT ${limit}
54
62
  `,
63
+ metric: "list_sessions",
55
64
  query_params: bag.values,
56
65
  };
57
66
  }
@@ -81,6 +90,7 @@ export function buildPointerHeatmap(projectId, opts, d) {
81
90
  GROUP BY gx, gy
82
91
  ORDER BY count DESC
83
92
  `,
93
+ metric: "pointer_heatmap",
84
94
  query_params: bag.values,
85
95
  };
86
96
  }
@@ -123,6 +133,7 @@ export function buildMeshUvHeatmap(projectId, opts, d) {
123
133
  GROUP BY gx, gy
124
134
  ORDER BY count DESC
125
135
  `,
136
+ metric: "mesh_uv_heatmap",
126
137
  query_params: bag.values,
127
138
  };
128
139
  }
@@ -156,6 +167,7 @@ export function buildWorldHeatmap(projectId, opts, d) {
156
167
  ORDER BY count DESC
157
168
  LIMIT ${limit}
158
169
  `,
170
+ metric: "world_heatmap",
159
171
  query_params: bag.values,
160
172
  };
161
173
  }
@@ -191,6 +203,7 @@ export function buildWorldHeatmapStats(projectId, opts, d) {
191
203
  GROUP BY vx, vy, vz
192
204
  ) t
193
205
  `,
206
+ metric: "world_heatmap_stats",
194
207
  query_params: bag.values,
195
208
  };
196
209
  }
@@ -229,6 +242,7 @@ export function buildGazeHeatmap(projectId, opts, d) {
229
242
  ORDER BY count DESC
230
243
  LIMIT ${limit}
231
244
  `,
245
+ metric: "gaze_heatmap",
232
246
  query_params: bag.values,
233
247
  };
234
248
  }
@@ -262,6 +276,7 @@ export function buildGazeHeatmapStats(projectId, opts, d) {
262
276
  GROUP BY vx, vy, vz
263
277
  ) t
264
278
  `,
279
+ metric: "gaze_heatmap_stats",
265
280
  query_params: bag.values,
266
281
  };
267
282
  }
@@ -290,6 +305,7 @@ export function buildCameraDirectionHeatmap(projectId, opts, d) {
290
305
  GROUP BY azimuth_bin, elevation_bin
291
306
  ORDER BY count DESC
292
307
  `,
308
+ metric: "camera_heatmap",
293
309
  query_params: bag.values,
294
310
  };
295
311
  }
@@ -339,6 +355,7 @@ export function buildViewCoverageHistogram(projectId, opts, d) {
339
355
  GROUP BY bucket
340
356
  ORDER BY bucket ASC
341
357
  `,
358
+ metric: "view_coverage_histogram",
342
359
  query_params: bag.values,
343
360
  };
344
361
  }
@@ -373,6 +390,7 @@ export function buildCameraPositionHeatmap(projectId, opts, d) {
373
390
  ORDER BY count DESC
374
391
  LIMIT ${limit}
375
392
  `,
393
+ metric: "position_heatmap",
376
394
  query_params: bag.values,
377
395
  };
378
396
  }
@@ -403,6 +421,7 @@ export function buildSessionTrajectory(projectId, opts, d) {
403
421
  ORDER BY ts ASC
404
422
  LIMIT ${limit}
405
423
  `,
424
+ metric: "session_trajectory",
406
425
  query_params: bag.values,
407
426
  };
408
427
  }
@@ -440,6 +459,7 @@ export function buildAggregateTrajectories(projectId, opts, d) {
440
459
  ORDER BY session_id ASC, ts ASC
441
460
  LIMIT ${limit}
442
461
  `,
462
+ metric: "aggregate_paths",
443
463
  query_params: bag.values,
444
464
  };
445
465
  }
@@ -566,6 +586,7 @@ export function buildClickGazeRay(projectId, opts, d) {
566
586
  ORDER BY count DESC
567
587
  LIMIT ${bag.add("limit", "u32", opts.limit ?? 500)}
568
588
  `,
589
+ metric: "click_rays",
569
590
  query_params: bag.values,
570
591
  };
571
592
  }
@@ -629,6 +650,7 @@ export function buildFlowHeatmap(projectId, opts, d) {
629
650
  ORDER BY count DESC
630
651
  LIMIT ${limit}
631
652
  `,
653
+ metric: "flow_links",
632
654
  query_params: bag.values,
633
655
  };
634
656
  }
@@ -695,6 +717,7 @@ export function buildFlowHeatmap(projectId, opts, d) {
695
717
  ORDER BY count DESC
696
718
  LIMIT ${limit}
697
719
  `,
720
+ metric: "flow_links",
698
721
  query_params: bag.values,
699
722
  };
700
723
  }
@@ -714,6 +737,7 @@ export function buildTopMeshes(projectId, opts, d) {
714
737
  ORDER BY count DESC
715
738
  LIMIT ${limit}
716
739
  `,
740
+ metric: "top_meshes",
717
741
  query_params: bag.values,
718
742
  };
719
743
  }
@@ -745,6 +769,7 @@ export function buildTopMeshesBySource(projectId, opts, d) {
745
769
  ORDER BY count DESC
746
770
  LIMIT ${limit}
747
771
  `,
772
+ metric: "mesh_sources",
748
773
  query_params: bag.values,
749
774
  };
750
775
  }
@@ -780,6 +805,7 @@ export function buildTopMeshesTrend(projectId, opts, d) {
780
805
  ORDER BY bucket ASC
781
806
  LIMIT ${limit}
782
807
  `,
808
+ metric: "mesh_trend",
783
809
  query_params: bag.values,
784
810
  };
785
811
  }
@@ -809,6 +835,7 @@ export function buildMeshDwell(projectId, opts, d) {
809
835
  ORDER BY sum(visible_ms) DESC
810
836
  LIMIT ${limit}
811
837
  `,
838
+ metric: "mesh_dwell",
812
839
  query_params: bag.values,
813
840
  };
814
841
  }
@@ -862,6 +889,7 @@ export function buildMeshBlindSpots(projectId, opts, d) {
862
889
  sum(CASE WHEN event_type = 'mesh_visibility' THEN visible_ms ELSE 0 END) DESC
863
890
  LIMIT ${limit}
864
891
  `,
892
+ metric: "mesh_blind_spots",
865
893
  query_params: bag.values,
866
894
  };
867
895
  }
@@ -894,6 +922,7 @@ export function buildMeshInteractionKinds(projectId, opts, d) {
894
922
  ORDER BY count DESC
895
923
  LIMIT ${limit}
896
924
  `,
925
+ metric: "mesh_interaction_kinds",
897
926
  query_params: bag.values,
898
927
  };
899
928
  }
@@ -968,6 +997,7 @@ export function buildReachability(projectId, opts, d) {
968
997
  ORDER BY count DESC
969
998
  LIMIT ${limit}
970
999
  `,
1000
+ metric: "mesh_reachability",
971
1001
  query_params: bag.values,
972
1002
  };
973
1003
  }
@@ -992,6 +1022,7 @@ export function buildDeadClicks(projectId, opts, d) {
992
1022
  FROM events
993
1023
  WHERE project_id = ${pid} AND event_type = 'pointer_click'${range}${scene}${source}${session}
994
1024
  `,
1025
+ metric: "dead_clicks",
995
1026
  query_params: bag.values,
996
1027
  };
997
1028
  }
@@ -1028,6 +1059,7 @@ export function buildRageClicks(projectId, opts, d) {
1028
1059
  ORDER BY clicks DESC
1029
1060
  LIMIT ${limit}
1030
1061
  `,
1062
+ metric: "rage_clicks",
1031
1063
  query_params: bag.values,
1032
1064
  };
1033
1065
  }
@@ -1060,6 +1092,7 @@ export function buildHoverDwell(projectId, opts, d) {
1060
1092
  ORDER BY dwell_ms DESC
1061
1093
  LIMIT ${limit}
1062
1094
  `,
1095
+ metric: "hover_dwell",
1063
1096
  query_params: bag.values,
1064
1097
  };
1065
1098
  }
@@ -1092,6 +1125,7 @@ export function buildCompileStalls(projectId, opts, d) {
1092
1125
  ORDER BY total_ms DESC
1093
1126
  LIMIT ${limit}
1094
1127
  `,
1128
+ metric: "compile_stalls",
1095
1129
  query_params: bag.values,
1096
1130
  };
1097
1131
  }
@@ -1124,6 +1158,7 @@ export function buildResourceSummary(projectId, opts, d) {
1124
1158
  FROM events
1125
1159
  WHERE project_id = ${pid} AND event_type = 'resource_sample'${range}${session}
1126
1160
  `,
1161
+ metric: "resource_summary",
1127
1162
  query_params: bag.values,
1128
1163
  };
1129
1164
  }
@@ -1168,6 +1203,7 @@ export function buildResourcePercentiles(projectId, opts, d) {
1168
1203
  GROUP BY session_id
1169
1204
  ) per_session
1170
1205
  `,
1206
+ metric: "resource_percentiles",
1171
1207
  query_params: bag.values,
1172
1208
  };
1173
1209
  }
@@ -1193,6 +1229,7 @@ export function buildStabilityCounts(projectId, opts, d) {
1193
1229
  FROM events
1194
1230
  WHERE project_id = ${pid} AND event_type IN ('context_lost', 'compile_stall')${range}${scene}${session}
1195
1231
  `,
1232
+ metric: "stability_counts",
1196
1233
  query_params: bag.values,
1197
1234
  };
1198
1235
  }
@@ -1235,6 +1272,7 @@ export function buildGraphicsDiagnosticCounts(projectId, opts, d) {
1235
1272
  GROUP BY severity, category, backend
1236
1273
  ORDER BY incidents DESC
1237
1274
  `,
1275
+ metric: "graphics_diagnostics",
1238
1276
  query_params: bag.values,
1239
1277
  };
1240
1278
  }
@@ -1291,6 +1329,7 @@ export function buildErrorHeatmap(projectId, opts, d) {
1291
1329
  ORDER BY count DESC
1292
1330
  LIMIT ${limit}
1293
1331
  `,
1332
+ metric: "error_heatmap",
1294
1333
  query_params: bag.values,
1295
1334
  };
1296
1335
  }
@@ -1333,6 +1372,7 @@ export function buildBoundaryHeatmap(projectId, opts, d) {
1333
1372
  ORDER BY count DESC
1334
1373
  LIMIT ${limit}
1335
1374
  `,
1375
+ metric: "boundary_heatmap",
1336
1376
  query_params: bag.values,
1337
1377
  };
1338
1378
  }
@@ -1367,6 +1407,7 @@ export function buildBoundaryHeatmapStats(projectId, opts, d) {
1367
1407
  GROUP BY vx, vy, vz
1368
1408
  ) t
1369
1409
  `,
1410
+ metric: "boundary_heatmap_stats",
1370
1411
  query_params: bag.values,
1371
1412
  };
1372
1413
  }
@@ -1403,6 +1444,7 @@ export function buildBoundaryContacts(projectId, opts, d) {
1403
1444
  ORDER BY contacts DESC
1404
1445
  LIMIT ${limit}
1405
1446
  `,
1447
+ metric: "xr_boundary_contacts",
1406
1448
  query_params: bag.values,
1407
1449
  };
1408
1450
  }
@@ -1441,6 +1483,7 @@ export function buildRenderingTechnology(projectId, opts, d) {
1441
1483
  GROUP BY api, backend, api_version, shading_language
1442
1484
  ORDER BY sessions DESC
1443
1485
  `,
1486
+ metric: "rendering_technology",
1444
1487
  query_params: bag.values,
1445
1488
  };
1446
1489
  }
@@ -1471,6 +1514,7 @@ export function buildCapabilityChanges(projectId, opts, d) {
1471
1514
  ORDER BY changes DESC
1472
1515
  LIMIT ${limit}
1473
1516
  `,
1517
+ metric: "capability_changes",
1474
1518
  query_params: bag.values,
1475
1519
  };
1476
1520
  }
@@ -1505,6 +1549,7 @@ export function buildCameraGestures(projectId, opts, d) {
1505
1549
  ORDER BY gestures DESC
1506
1550
  LIMIT ${limit}
1507
1551
  `,
1552
+ metric: "camera_gestures",
1508
1553
  query_params: bag.values,
1509
1554
  };
1510
1555
  }
@@ -1524,6 +1569,7 @@ export function buildPerfSummary(projectId, opts, d) {
1524
1569
  FROM events
1525
1570
  WHERE project_id = ${pid} AND event_type = 'frame_perf'${range}${session}
1526
1571
  `,
1572
+ metric: "perf_summary",
1527
1573
  query_params: bag.values,
1528
1574
  };
1529
1575
  }
@@ -1558,6 +1604,7 @@ export function buildRenderScaleTruth(projectId, opts, d) {
1558
1604
  FROM events
1559
1605
  WHERE project_id = ${pid} AND event_type = 'frame_perf'${range}${session}
1560
1606
  `,
1607
+ metric: "render_scale_truth",
1561
1608
  query_params: bag.values,
1562
1609
  };
1563
1610
  }
@@ -1595,6 +1642,7 @@ export function buildPerfDistribution(projectId, opts, d) {
1595
1642
  GROUP BY session_id
1596
1643
  ) per_session
1597
1644
  `,
1645
+ metric: "perf_distribution",
1598
1646
  query_params: bag.values,
1599
1647
  };
1600
1648
  }
@@ -1629,6 +1677,7 @@ export function buildFpsHistogram(projectId, opts, d) {
1629
1677
  GROUP BY bucket
1630
1678
  ORDER BY bucket ASC
1631
1679
  `,
1680
+ metric: "fps_histogram",
1632
1681
  query_params: bag.values,
1633
1682
  };
1634
1683
  }
@@ -1665,6 +1714,7 @@ export function buildFrameTimePercentiles(projectId, opts, d) {
1665
1714
  GROUP BY session_id
1666
1715
  ) per_session
1667
1716
  `,
1717
+ metric: "frame_time_percentiles",
1668
1718
  query_params: bag.values,
1669
1719
  };
1670
1720
  }
@@ -1699,6 +1749,7 @@ export function buildJankRate(projectId, opts, d) {
1699
1749
  GROUP BY session_id
1700
1750
  ) per_session
1701
1751
  `,
1752
+ metric: "jank_rate",
1702
1753
  query_params: bag.values,
1703
1754
  };
1704
1755
  }
@@ -1775,6 +1826,7 @@ export function buildPerfChurn(projectId, opts, d) {
1775
1826
  sum(had_stall) AS stall_churn_sessions
1776
1827
  FROM correlated
1777
1828
  `,
1829
+ metric: "perf_churn",
1778
1830
  query_params: bag.values,
1779
1831
  };
1780
1832
  }
@@ -1836,6 +1888,7 @@ export function buildPerfByDevice(projectId, opts, d) {
1836
1888
  GROUP BY engine, is_mobile, renderer, browser, os
1837
1889
  ORDER BY sessions DESC
1838
1890
  `,
1891
+ metric: "perf_by_device",
1839
1892
  query_params: bag.values,
1840
1893
  };
1841
1894
  }
@@ -1872,6 +1925,7 @@ export function buildPerfByScene(projectId, opts, d) {
1872
1925
  GROUP BY scene_id
1873
1926
  ORDER BY sessions DESC
1874
1927
  `,
1928
+ metric: "perf_by_scene",
1875
1929
  query_params: bag.values,
1876
1930
  };
1877
1931
  }
@@ -1898,6 +1952,7 @@ export function buildPerfDaily(projectId, opts, d) {
1898
1952
  ORDER BY day DESC
1899
1953
  LIMIT ${limit}
1900
1954
  `,
1955
+ metric: "perf_daily",
1901
1956
  query_params: bag.values,
1902
1957
  };
1903
1958
  }
@@ -1922,6 +1977,7 @@ export function buildEventsDaily(projectId, opts, d) {
1922
1977
  ORDER BY day DESC, sum(events) DESC
1923
1978
  LIMIT ${limit}
1924
1979
  `,
1980
+ metric: "events_daily",
1925
1981
  query_params: bag.values,
1926
1982
  };
1927
1983
  }
@@ -1946,6 +2002,7 @@ export function buildDistinctScenes(projectId, opts, d) {
1946
2002
  ORDER BY events DESC
1947
2003
  LIMIT ${limit}
1948
2004
  `,
2005
+ metric: "list_scenes",
1949
2006
  query_params: bag.values,
1950
2007
  };
1951
2008
  }
@@ -1974,6 +2031,7 @@ export function buildTimeseries(projectId, opts, d) {
1974
2031
  GROUP BY bucket
1975
2032
  ORDER BY bucket ASC
1976
2033
  `,
2034
+ metric: "timeseries",
1977
2035
  query_params: bag.values,
1978
2036
  };
1979
2037
  }
@@ -1994,6 +2052,7 @@ export function buildEventTypeCounts(projectId, opts, d) {
1994
2052
  GROUP BY event_type
1995
2053
  ORDER BY count DESC
1996
2054
  `,
2055
+ metric: "event_counts",
1997
2056
  query_params: bag.values,
1998
2057
  };
1999
2058
  }
@@ -2028,6 +2087,7 @@ export function buildSceneCoverage(projectId, opts, d) {
2028
2087
  ORDER BY count DESC
2029
2088
  LIMIT ${limit}
2030
2089
  `,
2090
+ metric: "scene_coverage",
2031
2091
  query_params: bag.values,
2032
2092
  };
2033
2093
  }
@@ -2069,6 +2129,7 @@ export function buildPerfHeatmap(projectId, opts, d) {
2069
2129
  ORDER BY avg_fps ASC
2070
2130
  LIMIT ${limit}
2071
2131
  `,
2132
+ metric: "perf_heatmap",
2072
2133
  query_params: bag.values,
2073
2134
  };
2074
2135
  }
@@ -2108,6 +2169,7 @@ export function buildCameraDistance(projectId, opts, d) {
2108
2169
  ORDER BY bucket ASC
2109
2170
  LIMIT ${limit}
2110
2171
  `,
2172
+ metric: "camera_distance",
2111
2173
  query_params: bag.values,
2112
2174
  };
2113
2175
  }
@@ -2166,6 +2228,7 @@ export function buildNavigationStats(projectId, opts, d) {
2166
2228
  ORDER BY total_distance DESC
2167
2229
  LIMIT ${limit}
2168
2230
  `,
2231
+ metric: "navigation_stats",
2169
2232
  query_params: bag.values,
2170
2233
  };
2171
2234
  }
@@ -2258,6 +2321,7 @@ export function buildBacktrackRatio(projectId, opts, d) {
2258
2321
  ORDER BY backtrack_ratio DESC, entries DESC
2259
2322
  LIMIT ${limit}
2260
2323
  `,
2324
+ metric: "backtrack_ratio",
2261
2325
  query_params: bag.values,
2262
2326
  };
2263
2327
  }
@@ -2301,6 +2365,7 @@ export function buildInteractionsBySource(projectId, opts, d) {
2301
2365
  ORDER BY count DESC
2302
2366
  LIMIT ${limit}
2303
2367
  `,
2368
+ metric: "interaction_sources",
2304
2369
  query_params: bag.values,
2305
2370
  };
2306
2371
  }
@@ -2333,6 +2398,7 @@ export function buildTopInputActions(projectId, opts, d) {
2333
2398
  ORDER BY count DESC
2334
2399
  LIMIT ${limit}
2335
2400
  `,
2401
+ metric: "top_input_actions",
2336
2402
  query_params: bag.values,
2337
2403
  };
2338
2404
  }
@@ -2394,6 +2460,7 @@ export function buildXrRotationRate(projectId, opts, d) {
2394
2460
  ORDER BY total_turn_rad DESC
2395
2461
  LIMIT ${limit}
2396
2462
  `,
2463
+ metric: "xr_rotation",
2397
2464
  query_params: bag.values,
2398
2465
  };
2399
2466
  }
@@ -2424,6 +2491,7 @@ export function buildXrSourceUsage(projectId, opts, d) {
2424
2491
  ORDER BY interactions DESC
2425
2492
  LIMIT ${limit}
2426
2493
  `,
2494
+ metric: "xr_sources",
2427
2495
  query_params: bag.values,
2428
2496
  };
2429
2497
  }
@@ -2462,6 +2530,7 @@ export function buildXrAbandonment(projectId, opts, d) {
2462
2530
  ORDER BY started_at DESC
2463
2531
  LIMIT ${limit}
2464
2532
  `,
2533
+ metric: "xr_abandonment",
2465
2534
  query_params: bag.values,
2466
2535
  };
2467
2536
  }
@@ -2510,6 +2579,7 @@ export function buildXrLocomotionComfort(projectId, opts, d) {
2510
2579
  ORDER BY locomotion_ms DESC
2511
2580
  LIMIT ${limit}
2512
2581
  `,
2582
+ metric: "xr_locomotion",
2513
2583
  query_params: bag.values,
2514
2584
  };
2515
2585
  }
@@ -2563,6 +2633,7 @@ export function buildTrackingQuality(projectId, opts, d) {
2563
2633
  ORDER BY degraded_ms DESC
2564
2634
  LIMIT ${limit}
2565
2635
  `,
2636
+ metric: "xr_tracking_quality",
2566
2637
  query_params: bag.values,
2567
2638
  };
2568
2639
  }
@@ -2636,6 +2707,7 @@ export function buildArPlacementTimeToPlace(projectId, opts, d) {
2636
2707
  GROUP BY bucket
2637
2708
  ORDER BY bucket ASC
2638
2709
  `,
2710
+ metric: "ar_placement_time_to_place",
2639
2711
  query_params: bag.values,
2640
2712
  };
2641
2713
  }
@@ -2666,6 +2738,7 @@ export function buildArPlacementAttempts(projectId, opts, d) {
2666
2738
  GROUP BY attempts
2667
2739
  ORDER BY attempts ASC
2668
2740
  `,
2741
+ metric: "ar_placement_attempts",
2669
2742
  query_params: bag.values,
2670
2743
  };
2671
2744
  }
@@ -2699,6 +2772,7 @@ export function buildArPlacementSurfaces(projectId, opts, d) {
2699
2772
  GROUP BY surface
2700
2773
  ORDER BY placements DESC
2701
2774
  `,
2775
+ metric: "ar_placement_surfaces",
2702
2776
  query_params: bag.values,
2703
2777
  };
2704
2778
  }
@@ -2741,6 +2815,7 @@ export function buildFunnel(projectId, opts, d) {
2741
2815
  ${counts}
2742
2816
  ORDER BY step ASC
2743
2817
  `,
2818
+ metric: "funnel",
2744
2819
  query_params: bag.values,
2745
2820
  };
2746
2821
  }
@@ -2798,6 +2873,7 @@ export function buildSceneRetention(projectId, opts, d) {
2798
2873
  ORDER BY sessions DESC, from_scene ASC, to_scene ASC
2799
2874
  LIMIT ${limit}
2800
2875
  `,
2876
+ metric: "scene_retention",
2801
2877
  query_params: bag.values,
2802
2878
  };
2803
2879
  }
@@ -2875,6 +2951,7 @@ export function buildLoadBounceFunnel(projectId, opts, d) {
2875
2951
  GROUP BY band
2876
2952
  ORDER BY band ASC
2877
2953
  `,
2954
+ metric: "load_bounce_funnel",
2878
2955
  query_params: bag.values,
2879
2956
  };
2880
2957
  }
@@ -3024,6 +3101,7 @@ export function buildVariantLeaderboard(projectId, opts, d) {
3024
3101
  ORDER BY vc.views DESC, vc.variant ASC
3025
3102
  LIMIT ${limit}
3026
3103
  `,
3104
+ metric: "variant_leaderboard",
3027
3105
  query_params: bag.values,
3028
3106
  };
3029
3107
  }