@uptimizr/db 2.0.1 → 2.1.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.
- package/AGENTS.md +228 -3
- package/README.md +13 -0
- package/dist/duckdb/migrations.d.ts.map +1 -1
- package/dist/duckdb/migrations.js +169 -0
- package/dist/duckdb/migrations.js.map +1 -1
- package/dist/duckdb/panelSpecs.d.ts +29 -0
- package/dist/duckdb/panelSpecs.d.ts.map +1 -0
- package/dist/duckdb/panelSpecs.js +104 -0
- package/dist/duckdb/panelSpecs.js.map +1 -0
- package/dist/duckdb/projectMetadata.d.ts +43 -0
- package/dist/duckdb/projectMetadata.d.ts.map +1 -0
- package/dist/duckdb/projectMetadata.js +222 -0
- package/dist/duckdb/projectMetadata.js.map +1 -0
- package/dist/duckdb/subscriptions.d.ts +45 -0
- package/dist/duckdb/subscriptions.d.ts.map +1 -0
- package/dist/duckdb/subscriptions.js +202 -0
- package/dist/duckdb/subscriptions.js.map +1 -0
- package/dist/index.d.ts +18 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +48 -3
- package/dist/index.js.map +1 -1
- package/dist/insights/anomalies.d.ts +213 -0
- package/dist/insights/anomalies.d.ts.map +1 -0
- package/dist/insights/anomalies.js +340 -0
- package/dist/insights/anomalies.js.map +1 -0
- package/dist/insights/baseline.d.ts +51 -0
- package/dist/insights/baseline.d.ts.map +1 -0
- package/dist/insights/baseline.js +48 -0
- package/dist/insights/baseline.js.map +1 -0
- package/dist/insights/buckets.d.ts +114 -0
- package/dist/insights/buckets.d.ts.map +1 -0
- package/dist/insights/buckets.js +220 -0
- package/dist/insights/buckets.js.map +1 -0
- package/dist/insights/changepoint.d.ts +130 -0
- package/dist/insights/changepoint.d.ts.map +1 -0
- package/dist/insights/changepoint.js +209 -0
- package/dist/insights/changepoint.js.map +1 -0
- package/dist/insights/evaluate.d.ts +63 -0
- package/dist/insights/evaluate.d.ts.map +1 -0
- package/dist/insights/evaluate.js +158 -0
- package/dist/insights/evaluate.js.map +1 -0
- package/dist/insights/health.d.ts +219 -0
- package/dist/insights/health.d.ts.map +1 -0
- package/dist/insights/health.js +349 -0
- package/dist/insights/health.js.map +1 -0
- package/dist/insights/index.d.ts +45 -0
- package/dist/insights/index.d.ts.map +1 -0
- package/dist/insights/index.js +40 -0
- package/dist/insights/index.js.map +1 -0
- package/dist/insights/measures.d.ts +222 -0
- package/dist/insights/measures.d.ts.map +1 -0
- package/dist/insights/measures.js +431 -0
- package/dist/insights/measures.js.map +1 -0
- package/dist/insights/movers.d.ts +123 -0
- package/dist/insights/movers.d.ts.map +1 -0
- package/dist/insights/movers.js +166 -0
- package/dist/insights/movers.js.map +1 -0
- package/dist/insights/significance.d.ts +221 -0
- package/dist/insights/significance.d.ts.map +1 -0
- package/dist/insights/significance.js +531 -0
- package/dist/insights/significance.js.map +1 -0
- package/dist/insights/stats.d.ts +104 -0
- package/dist/insights/stats.d.ts.map +1 -0
- package/dist/insights/stats.js +181 -0
- package/dist/insights/stats.js.map +1 -0
- package/dist/insights/windows.d.ts +95 -0
- package/dist/insights/windows.d.ts.map +1 -0
- package/dist/insights/windows.js +97 -0
- package/dist/insights/windows.js.map +1 -0
- package/dist/metadata.d.ts +178 -1
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js +80 -0
- package/dist/metadata.js.map +1 -1
- package/dist/narrative/build.d.ts +78 -0
- package/dist/narrative/build.d.ts.map +1 -0
- package/dist/narrative/build.js +437 -0
- package/dist/narrative/build.js.map +1 -0
- package/dist/narrative/index.d.ts +14 -0
- package/dist/narrative/index.d.ts.map +1 -0
- package/dist/narrative/index.js +13 -0
- package/dist/narrative/index.js.map +1 -0
- package/dist/narrative/text.d.ts +25 -0
- package/dist/narrative/text.d.ts.map +1 -0
- package/dist/narrative/text.js +41 -0
- package/dist/narrative/text.js.map +1 -0
- package/dist/parity/cases.d.ts +3 -0
- package/dist/parity/cases.d.ts.map +1 -1
- package/dist/parity/cases.js +387 -7
- package/dist/parity/cases.js.map +1 -1
- package/dist/parity/compare.d.ts +19 -0
- package/dist/parity/compare.d.ts.map +1 -1
- package/dist/parity/compare.js +19 -0
- package/dist/parity/compare.js.map +1 -1
- package/dist/parity/fixtures.d.ts.map +1 -1
- package/dist/parity/fixtures.js +25 -0
- package/dist/parity/fixtures.js.map +1 -1
- package/dist/query/aggregations.d.ts +46 -1
- package/dist/query/aggregations.d.ts.map +1 -1
- package/dist/query/aggregations.js +86 -0
- package/dist/query/aggregations.js.map +1 -1
- package/dist/query/clickhouseDialect.d.ts.map +1 -1
- package/dist/query/clickhouseDialect.js +5 -1
- package/dist/query/clickhouseDialect.js.map +1 -1
- package/dist/query/customEventVocabulary.d.ts +46 -0
- package/dist/query/customEventVocabulary.d.ts.map +1 -0
- package/dist/query/customEventVocabulary.js +127 -0
- package/dist/query/customEventVocabulary.js.map +1 -0
- package/dist/query/dsl/builders.d.ts +38 -0
- package/dist/query/dsl/builders.d.ts.map +1 -0
- package/dist/query/dsl/builders.js +35 -0
- package/dist/query/dsl/builders.js.map +1 -0
- package/dist/query/dsl/compare.d.ts +167 -0
- package/dist/query/dsl/compare.d.ts.map +1 -0
- package/dist/query/dsl/compare.js +358 -0
- package/dist/query/dsl/compare.js.map +1 -0
- package/dist/query/dsl/compile.d.ts +89 -0
- package/dist/query/dsl/compile.d.ts.map +1 -0
- package/dist/query/dsl/compile.js +174 -0
- package/dist/query/dsl/compile.js.map +1 -0
- package/dist/query/dsl/explain.d.ts +115 -0
- package/dist/query/dsl/explain.d.ts.map +1 -0
- package/dist/query/dsl/explain.js +143 -0
- package/dist/query/dsl/explain.js.map +1 -0
- package/dist/query/dsl/generic.d.ts +127 -0
- package/dist/query/dsl/generic.d.ts.map +1 -0
- package/dist/query/dsl/generic.js +323 -0
- package/dist/query/dsl/generic.js.map +1 -0
- package/dist/query/dsl/index.d.ts +30 -0
- package/dist/query/dsl/index.d.ts.map +1 -0
- package/dist/query/dsl/index.js +23 -0
- package/dist/query/dsl/index.js.map +1 -0
- package/dist/query/dsl/order.d.ts +41 -0
- package/dist/query/dsl/order.d.ts.map +1 -0
- package/dist/query/dsl/order.js +55 -0
- package/dist/query/dsl/order.js.map +1 -0
- package/dist/query/dsl/significance.d.ts +130 -0
- package/dist/query/dsl/significance.d.ts.map +1 -0
- package/dist/query/dsl/significance.js +224 -0
- package/dist/query/dsl/significance.js.map +1 -0
- package/dist/query/index.d.ts +2 -0
- package/dist/query/index.d.ts.map +1 -1
- package/dist/query/index.js +8 -0
- package/dist/query/index.js.map +1 -1
- package/dist/query/summary/index.d.ts +4 -2
- package/dist/query/summary/index.d.ts.map +1 -1
- package/dist/query/summary/index.js +2 -1
- package/dist/query/summary/index.js.map +1 -1
- package/dist/query/summary/labels.d.ts +101 -0
- package/dist/query/summary/labels.d.ts.map +1 -0
- package/dist/query/summary/labels.js +261 -0
- package/dist/query/summary/labels.js.map +1 -0
- package/dist/query/summary/reading.d.ts.map +1 -1
- package/dist/query/summary/reading.js +21 -2
- package/dist/query/summary/reading.js.map +1 -1
- package/dist/query/summary/schema.d.ts +250 -20
- package/dist/query/summary/schema.d.ts.map +1 -1
- package/dist/query/summary/schema.js +135 -123
- package/dist/query/summary/schema.js.map +1 -1
- package/dist/query/summary/summarize.d.ts.map +1 -1
- package/dist/query/summary/summarize.js +91 -5
- package/dist/query/summary/summarize.js.map +1 -1
- package/dist/query/summary/types.d.ts +77 -2
- package/dist/query/summary/types.d.ts.map +1 -1
- package/dist/query/types.d.ts +47 -1
- package/dist/query/types.d.ts.map +1 -1
- package/dist/subscriptions.d.ts +208 -0
- package/dist/subscriptions.d.ts.map +1 -0
- package/dist/subscriptions.js +153 -0
- package/dist/subscriptions.js.map +1 -0
- package/llms.txt +9 -0
- package/package.json +8 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/narrative/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
/**
|
|
2
|
+
* Session narrative — the `query:raw`-gated compaction of one session's raw
|
|
3
|
+
* event stream into an ordered, bounded account of what it did
|
|
4
|
+
* (ADR 0051 §7, design sketch §G.2).
|
|
5
|
+
*
|
|
6
|
+
* Pure functions over `AnyEvent[]`: no store, no request, no I/O. The collector
|
|
7
|
+
* serves them on `GET /api/v1/sessions/:id/narrative`; the shapes and bounds
|
|
8
|
+
* live in `@uptimizr/metrics` so the registry entry, the generated tool and this
|
|
9
|
+
* implementation cannot drift.
|
|
10
|
+
*/
|
|
11
|
+
export { buildSessionNarrative } from "./build.js";
|
|
12
|
+
export type { SessionNarrative, SessionNarrativeOptions } from "./build.js";
|
|
13
|
+
export { renderSessionNarrativeText } from "./text.js";
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/narrative/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,YAAY,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session narrative — the `query:raw`-gated compaction of one session's raw
|
|
3
|
+
* event stream into an ordered, bounded account of what it did
|
|
4
|
+
* (ADR 0051 §7, design sketch §G.2).
|
|
5
|
+
*
|
|
6
|
+
* Pure functions over `AnyEvent[]`: no store, no request, no I/O. The collector
|
|
7
|
+
* serves them on `GET /api/v1/sessions/:id/narrative`; the shapes and bounds
|
|
8
|
+
* live in `@uptimizr/metrics` so the registry entry, the generated tool and this
|
|
9
|
+
* implementation cannot drift.
|
|
10
|
+
*/
|
|
11
|
+
export { buildSessionNarrative } from "./build.js";
|
|
12
|
+
export { renderSessionNarrativeText } from "./text.js";
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/narrative/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `renderSessionNarrativeText` — the `format=text` rendering of a session
|
|
3
|
+
* narrative (ADR 0051 §7).
|
|
4
|
+
*
|
|
5
|
+
* Why a third format at all, when `full` and `table` already exist: the
|
|
6
|
+
* narrative's one consumer is a language model reading a session back, and a
|
|
7
|
+
* JSON array of two hundred objects spends most of its tokens on repeated key
|
|
8
|
+
* names. A line-per-entry rendering of the same data is roughly a third of the
|
|
9
|
+
* tokens and is what a model reads best. It is **only** offered on this route;
|
|
10
|
+
* no other endpoint gains a text format (design sketch §B.1 keeps `full`,
|
|
11
|
+
* `table` and `summary` as the shared envelopes).
|
|
12
|
+
*
|
|
13
|
+
* The output is derived entirely from the narrative's own fields — this module
|
|
14
|
+
* adds no information and reads no event — so the privacy allow-list enforced by
|
|
15
|
+
* `buildSessionNarrative` holds for it unchanged.
|
|
16
|
+
*/
|
|
17
|
+
import type { SessionNarrative } from "./build.js";
|
|
18
|
+
/**
|
|
19
|
+
* Render a narrative as plain text: a header line naming the session and its
|
|
20
|
+
* span, then one line per entry (`<t> <kind> <summary>`), oldest first, ending
|
|
21
|
+
* with the totals line. Never longer than the narrative's own entry count plus
|
|
22
|
+
* one, so `maxEntries` bounds the text exactly as it bounds the JSON.
|
|
23
|
+
*/
|
|
24
|
+
export declare function renderSessionNarrativeText(narrative: SessionNarrative): string;
|
|
25
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/narrative/text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAQnD;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM,CAY9E"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `renderSessionNarrativeText` — the `format=text` rendering of a session
|
|
3
|
+
* narrative (ADR 0051 §7).
|
|
4
|
+
*
|
|
5
|
+
* Why a third format at all, when `full` and `table` already exist: the
|
|
6
|
+
* narrative's one consumer is a language model reading a session back, and a
|
|
7
|
+
* JSON array of two hundred objects spends most of its tokens on repeated key
|
|
8
|
+
* names. A line-per-entry rendering of the same data is roughly a third of the
|
|
9
|
+
* tokens and is what a model reads best. It is **only** offered on this route;
|
|
10
|
+
* no other endpoint gains a text format (design sketch §B.1 keeps `full`,
|
|
11
|
+
* `table` and `summary` as the shared envelopes).
|
|
12
|
+
*
|
|
13
|
+
* The output is derived entirely from the narrative's own fields — this module
|
|
14
|
+
* adds no information and reads no event — so the privacy allow-list enforced by
|
|
15
|
+
* `buildSessionNarrative` holds for it unchanged.
|
|
16
|
+
*/
|
|
17
|
+
/** `1200` → `"1.2s"`, padded so the timestamps form a readable column. */
|
|
18
|
+
function stamp(tMs) {
|
|
19
|
+
const seconds = (tMs / 1000).toFixed(1);
|
|
20
|
+
return `${seconds}s`.padStart(8);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Render a narrative as plain text: a header line naming the session and its
|
|
24
|
+
* span, then one line per entry (`<t> <kind> <summary>`), oldest first, ending
|
|
25
|
+
* with the totals line. Never longer than the narrative's own entry count plus
|
|
26
|
+
* one, so `maxEntries` bounds the text exactly as it bounds the JSON.
|
|
27
|
+
*/
|
|
28
|
+
export function renderSessionNarrativeText(narrative) {
|
|
29
|
+
const { totals } = narrative;
|
|
30
|
+
const lines = [
|
|
31
|
+
`session ${narrative.sessionId} — ${totals.events} events over ` +
|
|
32
|
+
`${(totals.durationMs / 1000).toFixed(1)}s` +
|
|
33
|
+
(narrative.truncated ? " (truncated)" : ""),
|
|
34
|
+
];
|
|
35
|
+
const width = narrative.entries.reduce((max, entry) => Math.max(max, entry.kind.length), 0);
|
|
36
|
+
for (const entry of narrative.entries) {
|
|
37
|
+
lines.push(`${stamp(entry.tMs)} ${entry.kind.padEnd(width)} ${entry.summary}`);
|
|
38
|
+
}
|
|
39
|
+
return `${lines.join("\n")}\n`;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/narrative/text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,0EAA0E;AAC1E,SAAS,KAAK,CAAC,GAAW;IACxB,MAAM,OAAO,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACxC,OAAO,GAAG,OAAO,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AACnC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CAAC,SAA2B;IACpE,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAC7B,MAAM,KAAK,GAAG;QACZ,WAAW,SAAS,CAAC,SAAS,MAAM,MAAM,CAAC,MAAM,eAAe;YAC9D,GAAG,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG;YAC3C,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;KAC9C,CAAC;IACF,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5F,KAAK,MAAM,KAAK,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC;QACtC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;IACD,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACjC,CAAC"}
|
package/dist/parity/cases.d.ts
CHANGED
|
@@ -27,5 +27,8 @@ export interface ParityCase {
|
|
|
27
27
|
/** Engine-independent expected output. */
|
|
28
28
|
readonly golden: readonly ParityRow[];
|
|
29
29
|
}
|
|
30
|
+
/** Every case the cross-engine harness runs: delegated, then generic, then insights. */
|
|
30
31
|
export declare const PARITY_CASES: readonly ParityCase[];
|
|
32
|
+
/** The subset compiled through the generic group-by tier (#304). */
|
|
33
|
+
export declare const GENERIC_PARITY_CASE_NAMES: readonly string[];
|
|
31
34
|
//# sourceMappingURL=cases.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cases.d.ts","sourceRoot":"","sources":["../../src/parity/cases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"cases.d.ts","sourceRoot":"","sources":["../../src/parity/cases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAuEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAS9C,MAAM,WAAW,UAAU;IACzB,8CAA8C;IAC9C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yDAAyD;IACzD,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IACnC,iEAAiE;IACjE,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,iEAAiE;IACjE,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,CAAC;CACvC;AA60CD,wFAAwF;AACxF,eAAO,MAAM,YAAY,EAAE,SAAS,UAAU,EAI7C,CAAC;AAEF,oEAAoE;AACpE,eAAO,MAAM,yBAAyB,EAAE,SAAS,MAAM,EAEtD,CAAC"}
|
package/dist/parity/cases.js
CHANGED
|
@@ -12,18 +12,21 @@
|
|
|
12
12
|
* float-tolerant on continuous columns, integer-exact on bin indices, and
|
|
13
13
|
* temporal projection columns excluded.
|
|
14
14
|
*/
|
|
15
|
-
import { buildCameraDirectionHeatmap, buildCameraDistance, buildCameraPositionHeatmap, buildClickGazeRay, buildDistinctScenes, buildEventTypeCounts, buildEventsDaily, buildFlowHeatmap, buildListSessions, buildMeshDwell, buildMeshBlindSpots, buildMeshInteractionKinds, buildReachability, buildTopInputActions, buildDeadClicks, buildRageClicks, buildHoverDwell, buildCompileStalls, buildResourceSummary, buildCapabilityChanges, buildCameraGestures, buildNavigationStats, buildBacktrackRatio, buildXrRotationRate, buildXrSourceUsage, buildXrAbandonment, buildXrLocomotionComfort, buildTrackingQuality, buildInteractionsBySource, buildArPlacementTimeToPlace, buildArPlacementAttempts, buildArPlacementSurfaces, buildFunnel, buildLoadBounceFunnel, buildPerfDaily, buildPerfSummary, buildRenderScaleTruth, buildPerfDistribution, buildFpsHistogram, buildFrameTimePercentiles, buildJankRate, buildPerfByDevice, buildPerfByScene, buildResourcePercentiles, buildStabilityCounts, buildGraphicsDiagnosticCounts, buildErrorHeatmap, buildBoundaryHeatmap, buildBoundaryHeatmapStats, buildBoundaryContacts, buildRenderingTechnology, buildPointerHeatmap, buildMeshUvHeatmap, buildSceneCoverage, buildPerfHeatmap, buildSessionTrajectory, buildAggregateTrajectories, buildTimeseries, buildTopMeshes, buildTopMeshesBySource, buildTopMeshesTrend, buildWorldHeatmap, buildWorldHeatmapStats, buildGazeHeatmap, buildGazeHeatmapStats, } from "../query/aggregations.js";
|
|
15
|
+
import { buildCameraDirectionHeatmap, buildCameraDistance, buildCameraPositionHeatmap, buildClickGazeRay, buildDistinctScenes, buildEventTypeCounts, buildEventsDaily, buildFlowHeatmap, buildListSessions, buildMeshDwell, buildMeshBlindSpots, buildMeshInteractionKinds, buildReachability, buildTopInputActions, buildCustomEventVocabulary, buildDeadClicks, buildRageClicks, buildHoverDwell, buildCompileStalls, buildResourceSummary, buildCapabilityChanges, buildCameraGestures, buildNavigationStats, buildBacktrackRatio, buildXrRotationRate, buildXrSourceUsage, buildXrAbandonment, buildXrLocomotionComfort, buildTrackingQuality, buildInteractionsBySource, buildArPlacementTimeToPlace, buildArPlacementAttempts, buildArPlacementSurfaces, buildFunnel, buildLoadBounceFunnel, buildPerfDaily, buildPerfSummary, buildRenderScaleTruth, buildPerfDistribution, buildFpsHistogram, buildFrameTimePercentiles, buildJankRate, buildPerfByDevice, buildPerfByScene, buildResourcePercentiles, buildStabilityCounts, buildGraphicsDiagnosticCounts, buildErrorHeatmap, buildBoundaryHeatmap, buildBoundaryHeatmapStats, buildBoundaryContacts, buildRenderingTechnology, buildPointerHeatmap, buildMeshUvHeatmap, buildSceneCoverage, buildPerfHeatmap, buildSessionTrajectory, buildAggregateTrajectories, buildTimeseries, buildTopMeshes, buildTopMeshesBySource, buildTopMeshesTrend, buildWorldHeatmap, buildWorldHeatmapStats, buildGazeHeatmap, buildGazeHeatmapStats, } from "../query/aggregations.js";
|
|
16
|
+
import { buildMetricBuckets } from "../insights/buckets.js";
|
|
17
|
+
import { compileQuery } from "../query/dsl/index.js";
|
|
18
|
+
import { queryV1Schema } from "@uptimizr/schema";
|
|
16
19
|
import { PARITY_DAY, PARITY_DAY_RANGE, PARITY_PROJECT_ID, PARITY_RANGE, PARITY_T0, } from "./fixtures.js";
|
|
17
20
|
const PID = PARITY_PROJECT_ID;
|
|
18
|
-
|
|
21
|
+
const DELEGATED_PARITY_CASES = [
|
|
19
22
|
{
|
|
20
23
|
name: "listSessions",
|
|
21
24
|
build: (d) => buildListSessions(PID, PARITY_RANGE, d),
|
|
22
25
|
sortKeys: ["session_id"],
|
|
23
26
|
ignoreColumns: ["started_at", "ended_at"],
|
|
24
27
|
golden: [
|
|
25
|
-
{ session_id: "s1", visitor_id: "", events:
|
|
26
|
-
{ session_id: "s2", visitor_id: "", events:
|
|
28
|
+
{ session_id: "s1", visitor_id: "", events: 12 },
|
|
29
|
+
{ session_id: "s2", visitor_id: "", events: 11 },
|
|
27
30
|
],
|
|
28
31
|
},
|
|
29
32
|
{
|
|
@@ -380,6 +383,30 @@ export const PARITY_CASES = [
|
|
|
380
383
|
// engines (#75); real grouping is covered by the DuckDB unit suite.
|
|
381
384
|
golden: [],
|
|
382
385
|
},
|
|
386
|
+
{
|
|
387
|
+
// Custom-event vocabulary (ADR 0051 §5, design sketch §E.1). Three
|
|
388
|
+
// `add_to_cart` events (s1 + s2) and one `level_complete` (s1), so the
|
|
389
|
+
// totals are (3, 2 sessions) and (1, 1 session). The aggregation emits the
|
|
390
|
+
// totals once per sampled payload, so `add_to_cart` repeats three times and
|
|
391
|
+
// `level_complete` once — four rows in all, ranked by count.
|
|
392
|
+
//
|
|
393
|
+
// `sample_payload` is the raw event JSON as each engine stores it (Postgres
|
|
394
|
+
// normalises it through `jsonb`), so it is engine-dependent by construction
|
|
395
|
+
// and excluded from the comparison — exactly like the engine-formatted
|
|
396
|
+
// timestamps above. What must agree across engines is the counting and the
|
|
397
|
+
// sampling *shape*, which is what the golden pins. The fold from payloads to
|
|
398
|
+
// prop types is pure TypeScript and is unit-tested separately.
|
|
399
|
+
name: "customEventVocabulary",
|
|
400
|
+
build: (d) => buildCustomEventVocabulary(PID, PARITY_RANGE, d),
|
|
401
|
+
sortKeys: ["name", "count"],
|
|
402
|
+
ignoreColumns: ["sample_payload"],
|
|
403
|
+
golden: [
|
|
404
|
+
{ name: "add_to_cart", count: 3, sessions: 2 },
|
|
405
|
+
{ name: "add_to_cart", count: 3, sessions: 2 },
|
|
406
|
+
{ name: "add_to_cart", count: 3, sessions: 2 },
|
|
407
|
+
{ name: "level_complete", count: 1, sessions: 1 },
|
|
408
|
+
],
|
|
409
|
+
},
|
|
383
410
|
{
|
|
384
411
|
name: "perfSummary",
|
|
385
412
|
build: (d) => buildPerfSummary(PID, PARITY_RANGE, d),
|
|
@@ -697,6 +724,7 @@ export const PARITY_CASES = [
|
|
|
697
724
|
sortKeys: ["event_type"],
|
|
698
725
|
golden: [
|
|
699
726
|
{ day: PARITY_DAY, event_type: "camera_sample", events: 3 },
|
|
727
|
+
{ day: PARITY_DAY, event_type: "custom", events: 4 },
|
|
700
728
|
{ day: PARITY_DAY, event_type: "frame_perf", events: 3 },
|
|
701
729
|
{ day: PARITY_DAY, event_type: "graphics_diagnostic", events: 1 },
|
|
702
730
|
{ day: PARITY_DAY, event_type: "mesh_visibility", events: 2 },
|
|
@@ -713,15 +741,15 @@ export const PARITY_CASES = [
|
|
|
713
741
|
sortKeys: ["scene_id"],
|
|
714
742
|
ignoreColumns: ["last_seen"],
|
|
715
743
|
golden: [
|
|
716
|
-
{ scene_id: "arena", events:
|
|
717
|
-
{ scene_id: "lobby", events:
|
|
744
|
+
{ scene_id: "arena", events: 11 },
|
|
745
|
+
{ scene_id: "lobby", events: 12 },
|
|
718
746
|
],
|
|
719
747
|
},
|
|
720
748
|
{
|
|
721
749
|
name: "timeseries",
|
|
722
750
|
build: (d) => buildTimeseries(PID, { ...PARITY_RANGE, interval: 60 }, d),
|
|
723
751
|
sortKeys: ["bucket"],
|
|
724
|
-
golden: [{ bucket: PARITY_T0, events:
|
|
752
|
+
golden: [{ bucket: PARITY_T0, events: 23, avg_fps: 45 }],
|
|
725
753
|
},
|
|
726
754
|
{
|
|
727
755
|
name: "eventTypeCounts",
|
|
@@ -729,6 +757,7 @@ export const PARITY_CASES = [
|
|
|
729
757
|
sortKeys: ["event_type"],
|
|
730
758
|
golden: [
|
|
731
759
|
{ event_type: "camera_sample", count: 3 },
|
|
760
|
+
{ event_type: "custom", count: 4 },
|
|
732
761
|
{ event_type: "frame_perf", count: 3 },
|
|
733
762
|
{ event_type: "graphics_diagnostic", count: 1 },
|
|
734
763
|
{ event_type: "mesh_visibility", count: 2 },
|
|
@@ -895,5 +924,356 @@ export const PARITY_CASES = [
|
|
|
895
924
|
sortKeys: ["band"],
|
|
896
925
|
golden: [],
|
|
897
926
|
},
|
|
927
|
+
// --- Query DSL v1 (ADR 0051 §3) ----------------------------------------
|
|
928
|
+
//
|
|
929
|
+
// The delegated compiler renders a validated `queryV1` document through the
|
|
930
|
+
// metric's own builder, so in principle it cannot disagree with the cases
|
|
931
|
+
// above — and `src/__tests__/queryDsl.test.ts` proves that spec-for-spec, on
|
|
932
|
+
// every dialect. These three cases prove it the other way round, where it
|
|
933
|
+
// actually matters: the compiled SQL is *executed* on each engine and its rows
|
|
934
|
+
// are compared against the same engine-independent golden. A filter-mapping
|
|
935
|
+
// regression that produced valid-but-different SQL would fail here.
|
|
936
|
+
{
|
|
937
|
+
name: "dsl:topMeshes",
|
|
938
|
+
build: (d) => compileQuery(PID, queryV1Schema.parse({ v: 1, metric: "top_meshes", range: PARITY_RANGE }), d),
|
|
939
|
+
sortKeys: ["mesh"],
|
|
940
|
+
golden: [
|
|
941
|
+
{ mesh: "box", count: 2 },
|
|
942
|
+
{ mesh: "floor", count: 2 },
|
|
943
|
+
{ mesh: "sphere", count: 2 },
|
|
944
|
+
],
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
// A filtered query: `filters.source` must reach `SourceOptions.source`
|
|
948
|
+
// through the registry's `FILTER_TARGETS`, not by coincidence.
|
|
949
|
+
name: "dsl:meshSourcesFiltered",
|
|
950
|
+
build: (d) => compileQuery(PID, queryV1Schema.parse({
|
|
951
|
+
v: 1,
|
|
952
|
+
metric: "mesh_sources",
|
|
953
|
+
range: PARITY_RANGE,
|
|
954
|
+
filters: { source: "mouse" },
|
|
955
|
+
}), d),
|
|
956
|
+
sortKeys: ["mesh", "source"],
|
|
957
|
+
golden: [
|
|
958
|
+
{ mesh: "box", source: "mouse", count: 1 },
|
|
959
|
+
{ mesh: "floor", source: "mouse", count: 1 },
|
|
960
|
+
{ mesh: "sphere", source: "mouse", count: 1 },
|
|
961
|
+
],
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
// A funnel through the DSL: the ADR 0038 step predicates travel as real
|
|
965
|
+
// JSON rather than a re-parsed string, and land on `FunnelOptions.steps`.
|
|
966
|
+
name: "dsl:funnel",
|
|
967
|
+
build: (d) => compileQuery(PID, queryV1Schema.parse({
|
|
968
|
+
v: 1,
|
|
969
|
+
metric: "funnel",
|
|
970
|
+
range: PARITY_RANGE,
|
|
971
|
+
filters: {
|
|
972
|
+
steps: [{ type: "camera_sample" }, { type: "pointer_click", mesh: "sphere" }],
|
|
973
|
+
},
|
|
974
|
+
}), d),
|
|
975
|
+
sortKeys: ["step"],
|
|
976
|
+
golden: [
|
|
977
|
+
{ step: 0, sessions: 2 },
|
|
978
|
+
{ step: 1, sessions: 1 },
|
|
979
|
+
],
|
|
980
|
+
},
|
|
981
|
+
];
|
|
982
|
+
/**
|
|
983
|
+
* **Generic group-by tier** (ADR 0051 §3, design sketch §C.2 tier 2, #304).
|
|
984
|
+
*
|
|
985
|
+
* The delegated cases above prove the DSL reaches each metric's own builder.
|
|
986
|
+
* These prove the *other* compiler: one shared `SELECT <dims>, <measures> FROM
|
|
987
|
+
* events GROUP BY <dims>` rendered from registry data, executed on every engine
|
|
988
|
+
* and compared against the same hand-verified golden.
|
|
989
|
+
*
|
|
990
|
+
* Three metrics at two grains each, chosen to exercise every part of the
|
|
991
|
+
* builder: promoted columns alone (`top_meshes`, `event_counts`,
|
|
992
|
+
* `mesh_sources`), a two-dimension group-by, and the `session_start` attribute
|
|
993
|
+
* CTE that `device.*` and `cameraMode` are read through — which is the piece
|
|
994
|
+
* most likely to diverge between engines, since it is the only one that goes
|
|
995
|
+
* through `Dialect.jsonText` and a `LEFT JOIN`.
|
|
996
|
+
*
|
|
997
|
+
* Appended as a separate block rather than merged above so the v1 goldens stay
|
|
998
|
+
* exactly where #349 left them.
|
|
999
|
+
*/
|
|
1000
|
+
const GENERIC_PARITY_CASES = [
|
|
1001
|
+
{
|
|
1002
|
+
// `top_meshes` is keyed by `mesh`; asking for `(mesh, event_type)` splits
|
|
1003
|
+
// each mesh's tally by what actually referenced it — a passive visibility
|
|
1004
|
+
// sample versus a real click. The delegated builder cannot express it at all.
|
|
1005
|
+
name: "dsl:genericMeshesByEventType",
|
|
1006
|
+
build: (d) => compileQuery(PID, queryV1Schema.parse({
|
|
1007
|
+
v: 1,
|
|
1008
|
+
metric: "top_meshes",
|
|
1009
|
+
dimensions: ["mesh", "event_type"],
|
|
1010
|
+
range: PARITY_RANGE,
|
|
1011
|
+
}), d),
|
|
1012
|
+
sortKeys: ["mesh", "event_type"],
|
|
1013
|
+
golden: [
|
|
1014
|
+
{ mesh: "box", event_type: "mesh_visibility", count: 1 },
|
|
1015
|
+
{ mesh: "box", event_type: "pointer_click", count: 1 },
|
|
1016
|
+
{ mesh: "floor", event_type: "pointer_click", count: 1 },
|
|
1017
|
+
{ mesh: "floor", event_type: "pointer_move", count: 1 },
|
|
1018
|
+
{ mesh: "sphere", event_type: "mesh_visibility", count: 1 },
|
|
1019
|
+
{ mesh: "sphere", event_type: "pointer_click", count: 1 },
|
|
1020
|
+
],
|
|
1021
|
+
},
|
|
1022
|
+
{
|
|
1023
|
+
// The same metric regrouped onto a dimension it can only be *filtered* by on
|
|
1024
|
+
// the delegated tier — and, for `top_meshes`, not even that: its builder has
|
|
1025
|
+
// no scene clause at all.
|
|
1026
|
+
name: "dsl:genericMeshesByScene",
|
|
1027
|
+
build: (d) => compileQuery(PID, queryV1Schema.parse({
|
|
1028
|
+
v: 1,
|
|
1029
|
+
metric: "top_meshes",
|
|
1030
|
+
dimensions: ["scene"],
|
|
1031
|
+
range: PARITY_RANGE,
|
|
1032
|
+
}), d),
|
|
1033
|
+
sortKeys: ["scene_id"],
|
|
1034
|
+
golden: [
|
|
1035
|
+
{ scene_id: "arena", count: 2 },
|
|
1036
|
+
{ scene_id: "lobby", count: 4 },
|
|
1037
|
+
],
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
// Two promoted dimensions at once, over the whole event stream.
|
|
1041
|
+
name: "dsl:genericEventCountsByScene",
|
|
1042
|
+
build: (d) => compileQuery(PID, queryV1Schema.parse({
|
|
1043
|
+
v: 1,
|
|
1044
|
+
metric: "event_counts",
|
|
1045
|
+
dimensions: ["event_type", "scene"],
|
|
1046
|
+
range: PARITY_RANGE,
|
|
1047
|
+
}), d),
|
|
1048
|
+
sortKeys: ["event_type", "scene_id"],
|
|
1049
|
+
golden: [
|
|
1050
|
+
{ event_type: "camera_sample", scene_id: "arena", count: 1 },
|
|
1051
|
+
{ event_type: "camera_sample", scene_id: "lobby", count: 2 },
|
|
1052
|
+
{ event_type: "custom", scene_id: "arena", count: 2 },
|
|
1053
|
+
{ event_type: "custom", scene_id: "lobby", count: 2 },
|
|
1054
|
+
{ event_type: "frame_perf", scene_id: "arena", count: 1 },
|
|
1055
|
+
{ event_type: "frame_perf", scene_id: "lobby", count: 2 },
|
|
1056
|
+
{ event_type: "graphics_diagnostic", scene_id: "arena", count: 1 },
|
|
1057
|
+
{ event_type: "mesh_visibility", scene_id: "lobby", count: 2 },
|
|
1058
|
+
{ event_type: "pointer_click", scene_id: "arena", count: 1 },
|
|
1059
|
+
{ event_type: "pointer_click", scene_id: "lobby", count: 2 },
|
|
1060
|
+
{ event_type: "pointer_move", scene_id: "arena", count: 1 },
|
|
1061
|
+
{ event_type: "runtime_error", scene_id: "arena", count: 1 },
|
|
1062
|
+
{ event_type: "session_start", scene_id: "arena", count: 1 },
|
|
1063
|
+
{ event_type: "session_start", scene_id: "lobby", count: 1 },
|
|
1064
|
+
{ event_type: "xr_boundary_proximity", scene_id: "arena", count: 2 },
|
|
1065
|
+
{ event_type: "xr_boundary_proximity", scene_id: "lobby", count: 1 },
|
|
1066
|
+
],
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
// The session-attribute CTE: `device.engine` lives in the `session_start`
|
|
1070
|
+
// payload, so this is the case that proves `jsonText` + `LEFT JOIN` render
|
|
1071
|
+
// and group identically on all four engines.
|
|
1072
|
+
name: "dsl:genericEventCountsByEngine",
|
|
1073
|
+
build: (d) => compileQuery(PID, queryV1Schema.parse({
|
|
1074
|
+
v: 1,
|
|
1075
|
+
metric: "event_counts",
|
|
1076
|
+
dimensions: ["device.engine"],
|
|
1077
|
+
range: PARITY_RANGE,
|
|
1078
|
+
}), d),
|
|
1079
|
+
sortKeys: ["engine"],
|
|
1080
|
+
golden: [
|
|
1081
|
+
{ engine: "webgl2", count: 11 },
|
|
1082
|
+
{ engine: "webgpu", count: 12 },
|
|
1083
|
+
],
|
|
1084
|
+
},
|
|
1085
|
+
{
|
|
1086
|
+
// A metric with an `event_type` scope *and* a `mesh != ''` scope, regrouped:
|
|
1087
|
+
// the scope predicates must survive the regrouping or the counts inflate.
|
|
1088
|
+
name: "dsl:genericMeshSourcesByScene",
|
|
1089
|
+
build: (d) => compileQuery(PID, queryV1Schema.parse({
|
|
1090
|
+
v: 1,
|
|
1091
|
+
metric: "mesh_sources",
|
|
1092
|
+
dimensions: ["scene", "source"],
|
|
1093
|
+
range: PARITY_RANGE,
|
|
1094
|
+
}), d),
|
|
1095
|
+
sortKeys: ["scene_id", "source"],
|
|
1096
|
+
golden: [
|
|
1097
|
+
{ scene_id: "arena", source: "mouse", count: 1 },
|
|
1098
|
+
{ scene_id: "lobby", source: "mouse", count: 2 },
|
|
1099
|
+
],
|
|
1100
|
+
},
|
|
1101
|
+
{
|
|
1102
|
+
// Two measures (`count` and `count(DISTINCT session_id)`) over a session
|
|
1103
|
+
// attribute that is not a device field — the camera model (ADR 0026).
|
|
1104
|
+
name: "dsl:genericInteractionsByCameraMode",
|
|
1105
|
+
build: (d) => compileQuery(PID, queryV1Schema.parse({
|
|
1106
|
+
v: 1,
|
|
1107
|
+
metric: "interaction_sources",
|
|
1108
|
+
dimensions: ["cameraMode"],
|
|
1109
|
+
range: PARITY_RANGE,
|
|
1110
|
+
}), d),
|
|
1111
|
+
sortKeys: ["camera_mode"],
|
|
1112
|
+
golden: [
|
|
1113
|
+
{ camera_mode: "arc-rotate", count: 2, sessions: 1 },
|
|
1114
|
+
{ camera_mode: "free", count: 2, sessions: 1 },
|
|
1115
|
+
],
|
|
1116
|
+
},
|
|
1117
|
+
];
|
|
1118
|
+
/**
|
|
1119
|
+
* **Insight bucket series** (ADR 0051 §4, design sketch §D).
|
|
1120
|
+
*
|
|
1121
|
+
* `buildMetricBuckets` is the single query both insight primitives consume, and
|
|
1122
|
+
* the only per-dialect SQL they involve: every statistic over the series is pure
|
|
1123
|
+
* TypeScript. So parity here is parity for `baseline` and `movers` as a whole.
|
|
1124
|
+
* One case per *aggregate shape* the measure catalog can render — count,
|
|
1125
|
+
* distinct sessions, sum, quantile, and a geometry-guarded count — because the
|
|
1126
|
+
* shapes are what differ between engines, not the metrics.
|
|
1127
|
+
*
|
|
1128
|
+
* Every fixture event lands in the same UTC hour (2024-06-16 10:00), so each
|
|
1129
|
+
* series is a single bucket at `PARITY_T0`. That is the point: the fixtures fix
|
|
1130
|
+
* the *values*, and these cases fix the fact that four dialects render and
|
|
1131
|
+
* execute the same bucketing, the same aggregates and the same predicate
|
|
1132
|
+
* vocabulary to the same numbers.
|
|
1133
|
+
*
|
|
1134
|
+
* Appended last, as its own block, so the delegated and generic goldens stay
|
|
1135
|
+
* exactly where #349 and #304 left them.
|
|
1136
|
+
*/
|
|
1137
|
+
const INSIGHT_PARITY_CASES = [
|
|
1138
|
+
{
|
|
1139
|
+
// count(*) over every event type: all 23 fixture events in one hour bucket.
|
|
1140
|
+
name: "metricBuckets:count",
|
|
1141
|
+
build: (d) => buildMetricBuckets(PID, { ...PARITY_RANGE, metric: "list_sessions", bucket: "hour" }, d),
|
|
1142
|
+
sortKeys: ["bucket"],
|
|
1143
|
+
golden: [{ bucket: PARITY_T0, value: 23, sample_size: 23 }],
|
|
1144
|
+
},
|
|
1145
|
+
{
|
|
1146
|
+
// count(DISTINCT session_id) over `session_start`: s1 and s2.
|
|
1147
|
+
name: "metricBuckets:sessions",
|
|
1148
|
+
build: (d) => buildMetricBuckets(PID, { ...PARITY_RANGE, metric: "rendering_technology", bucket: "hour" }, d),
|
|
1149
|
+
sortKeys: ["bucket"],
|
|
1150
|
+
golden: [{ bucket: PARITY_T0, value: 2, sample_size: 2 }],
|
|
1151
|
+
},
|
|
1152
|
+
{
|
|
1153
|
+
// quantile(fps, 0.5) over the three `frame_perf` samples (60, 30, 45) → 45.
|
|
1154
|
+
name: "metricBuckets:quantile",
|
|
1155
|
+
build: (d) => buildMetricBuckets(PID, { ...PARITY_RANGE, metric: "perf_summary", bucket: "hour" }, d),
|
|
1156
|
+
sortKeys: ["bucket"],
|
|
1157
|
+
golden: [{ bucket: PARITY_T0, value: 45, sample_size: 3 }],
|
|
1158
|
+
},
|
|
1159
|
+
{
|
|
1160
|
+
// sum(visible_ms) over `mesh_visibility` with a non-empty mesh: 4000 + 2000.
|
|
1161
|
+
name: "metricBuckets:sum",
|
|
1162
|
+
build: (d) => buildMetricBuckets(PID, { ...PARITY_RANGE, metric: "mesh_dwell", bucket: "hour" }, d),
|
|
1163
|
+
sortKeys: ["bucket"],
|
|
1164
|
+
golden: [{ bucket: PARITY_T0, value: 6000, sample_size: 2 }],
|
|
1165
|
+
},
|
|
1166
|
+
{
|
|
1167
|
+
// The geometry guard: `camera_sample` rows whose `direction` carries all
|
|
1168
|
+
// three components — the same predicate `buildCameraDirectionHeatmap` applies
|
|
1169
|
+
// before it bins, so the series total equals that heatmap's own row total.
|
|
1170
|
+
name: "metricBuckets:geometry",
|
|
1171
|
+
build: (d) => buildMetricBuckets(PID, { ...PARITY_RANGE, metric: "camera_heatmap", bucket: "hour" }, d),
|
|
1172
|
+
sortKeys: ["bucket"],
|
|
1173
|
+
golden: [{ bucket: PARITY_T0, value: 3, sample_size: 3 }],
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
// Scene scoping plus an equality predicate: clicks in `lobby` that hit
|
|
1177
|
+
// nothing. Both lobby clicks hit a mesh, so the series is empty — a bucket
|
|
1178
|
+
// with no matching events is absent, never a zero row.
|
|
1179
|
+
name: "metricBuckets:emptySeries",
|
|
1180
|
+
build: (d) => buildMetricBuckets(PID, { ...PARITY_RANGE, metric: "dead_clicks", bucket: "hour", scene: "lobby" }, d),
|
|
1181
|
+
sortKeys: ["bucket"],
|
|
1182
|
+
golden: [],
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
// Day grain over the day-wide range: the same 19 events, one calendar-day
|
|
1186
|
+
// bucket, proving the grain is a parameter rather than a second query.
|
|
1187
|
+
name: "metricBuckets:dayGrain",
|
|
1188
|
+
build: (d) => buildMetricBuckets(PID, { ...PARITY_DAY_RANGE, metric: "list_sessions", bucket: "day" }, d),
|
|
1189
|
+
sortKeys: ["bucket"],
|
|
1190
|
+
golden: [{ bucket: Date.UTC(2024, 5, 16), value: 23, sample_size: 23 }],
|
|
1191
|
+
},
|
|
1192
|
+
// --- anomalies (#306): the grouped split --------------------------------
|
|
1193
|
+
//
|
|
1194
|
+
// The same measure, the same predicates, plus one promoted column in the
|
|
1195
|
+
// `SELECT` / `GROUP BY` / `ORDER BY`. It is what `anomalies` re-reads to say
|
|
1196
|
+
// *which* value inside a metric accounts for an anomalous bucket, and it is
|
|
1197
|
+
// the only new per-dialect SQL the primitive involves — so parity here is
|
|
1198
|
+
// parity for contributor attribution as a whole. One case per shape the split
|
|
1199
|
+
// has to survive: a multi-channel count, a summed value column, and a distinct
|
|
1200
|
+
// count (where the grouping key also changes what "distinct" ranges over).
|
|
1201
|
+
{
|
|
1202
|
+
// Split a two-channel error count by the channel: one diagnostic, one
|
|
1203
|
+
// runtime error, in the same hour bucket.
|
|
1204
|
+
name: "metricBuckets:splitEventType",
|
|
1205
|
+
build: (d) => buildMetricBuckets(PID, { ...PARITY_RANGE, metric: "error_heatmap", bucket: "hour", groupBy: "event_type" }, d),
|
|
1206
|
+
sortKeys: ["bucket", "dimension_value"],
|
|
1207
|
+
golden: [
|
|
1208
|
+
{ bucket: PARITY_T0, dimension_value: "graphics_diagnostic", value: 1, sample_size: 1 },
|
|
1209
|
+
{ bucket: PARITY_T0, dimension_value: "runtime_error", value: 1, sample_size: 1 },
|
|
1210
|
+
],
|
|
1211
|
+
},
|
|
1212
|
+
{
|
|
1213
|
+
// sum(visible_ms) split by mesh: the 6000 ms the ungrouped case reports is
|
|
1214
|
+
// 4000 on `box` and 2000 on `sphere` — the shares an attribution reads.
|
|
1215
|
+
name: "metricBuckets:splitMesh",
|
|
1216
|
+
build: (d) => buildMetricBuckets(PID, { ...PARITY_RANGE, metric: "mesh_dwell", bucket: "hour", groupBy: "mesh" }, d),
|
|
1217
|
+
sortKeys: ["bucket", "dimension_value"],
|
|
1218
|
+
golden: [
|
|
1219
|
+
{ bucket: PARITY_T0, dimension_value: "box", value: 4000, sample_size: 1 },
|
|
1220
|
+
{ bucket: PARITY_T0, dimension_value: "sphere", value: 2000, sample_size: 1 },
|
|
1221
|
+
],
|
|
1222
|
+
},
|
|
1223
|
+
{
|
|
1224
|
+
// count(DISTINCT session_id) split by scene: the grouping key narrows what
|
|
1225
|
+
// "distinct" ranges over, so the two sessions become one per scene rather
|
|
1226
|
+
// than two in both.
|
|
1227
|
+
name: "metricBuckets:splitScene",
|
|
1228
|
+
build: (d) => buildMetricBuckets(PID, { ...PARITY_RANGE, metric: "rendering_technology", bucket: "hour", groupBy: "scene" }, d),
|
|
1229
|
+
sortKeys: ["bucket", "dimension_value"],
|
|
1230
|
+
golden: [
|
|
1231
|
+
{ bucket: PARITY_T0, dimension_value: "arena", value: 1, sample_size: 1 },
|
|
1232
|
+
{ bucket: PARITY_T0, dimension_value: "lobby", value: 1, sample_size: 1 },
|
|
1233
|
+
],
|
|
1234
|
+
},
|
|
1235
|
+
// --- significance / scene health (#307) ---
|
|
1236
|
+
//
|
|
1237
|
+
// The named auxiliary series (`measures.ts`, `BUCKET_MEASURE_VARIANTS`) render
|
|
1238
|
+
// through the same builder, so only the shapes they *add* need a case: a rate
|
|
1239
|
+
// denominator, a new promoted value column, and a non-median quantile.
|
|
1240
|
+
{
|
|
1241
|
+
// A rate denominator: every `pointer_click`, against `dead_clicks`, whose
|
|
1242
|
+
// main measure counts only the clicks that hit nothing. Three clicks in the
|
|
1243
|
+
// fixtures; two of them hit a mesh, which is why the main series over the
|
|
1244
|
+
// same window is the one the `emptySeries` case pins.
|
|
1245
|
+
name: "metricBuckets:rateDenominator",
|
|
1246
|
+
build: (d) => buildMetricBuckets(PID, { ...PARITY_RANGE, metric: "dead_clicks", series: "denominator", bucket: "hour" }, d),
|
|
1247
|
+
sortKeys: ["bucket"],
|
|
1248
|
+
golden: [{ bucket: PARITY_T0, value: 3, sample_size: 3 }],
|
|
1249
|
+
},
|
|
1250
|
+
{
|
|
1251
|
+
// `sum(long_frames)` — a promoted column no main measure reads. The same
|
|
1252
|
+
// raw material `buildJankRate` sums per session, pooled here instead.
|
|
1253
|
+
name: "metricBuckets:longFrames",
|
|
1254
|
+
build: (d) => buildMetricBuckets(PID, { ...PARITY_RANGE, metric: "jank_rate", series: "numerator", bucket: "hour" }, d),
|
|
1255
|
+
sortKeys: ["bucket"],
|
|
1256
|
+
golden: [{ bucket: PARITY_T0, value: 8, sample_size: 3 }],
|
|
1257
|
+
},
|
|
1258
|
+
{
|
|
1259
|
+
// A tail quantile rather than the median: q = 0.05 over the three
|
|
1260
|
+
// `frame_perf` samples (60, 30, 45) is 30 + (45 - 30) * 0.1 = 31.5 under
|
|
1261
|
+
// the type-7 interpolation all four dialects use. It lands *between* two
|
|
1262
|
+
// samples rather than on one, which is exactly why it needs a case of its
|
|
1263
|
+
// own: an engine that returned an actual element instead of interpolating
|
|
1264
|
+
// would pass `metricBuckets:quantile` and fail here.
|
|
1265
|
+
name: "metricBuckets:tailQuantile",
|
|
1266
|
+
build: (d) => buildMetricBuckets(PID, { ...PARITY_RANGE, metric: "perf_summary", series: "p05", bucket: "hour" }, d),
|
|
1267
|
+
sortKeys: ["bucket"],
|
|
1268
|
+
golden: [{ bucket: PARITY_T0, value: 31.5, sample_size: 3 }],
|
|
1269
|
+
},
|
|
1270
|
+
];
|
|
1271
|
+
/** Every case the cross-engine harness runs: delegated, then generic, then insights. */
|
|
1272
|
+
export const PARITY_CASES = [
|
|
1273
|
+
...DELEGATED_PARITY_CASES,
|
|
1274
|
+
...GENERIC_PARITY_CASES,
|
|
1275
|
+
...INSIGHT_PARITY_CASES,
|
|
898
1276
|
];
|
|
1277
|
+
/** The subset compiled through the generic group-by tier (#304). */
|
|
1278
|
+
export const GENERIC_PARITY_CASE_NAMES = GENERIC_PARITY_CASES.map((parityCase) => parityCase.name);
|
|
899
1279
|
//# sourceMappingURL=cases.js.map
|