@grafana/scenes 6.36.0--canary.1240.17760349466.0 → 6.36.0--canary.1248.17797615374.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/scenes",
3
- "version": "6.36.0--canary.1240.17760349466.0",
3
+ "version": "6.36.0--canary.1248.17797615374.0",
4
4
  "description": "Grafana framework for building dynamic dashboards",
5
5
  "author": "Grafana Labs",
6
6
  "license": "Apache-2.0",
@@ -125,5 +125,5 @@
125
125
  "prettier --write"
126
126
  ]
127
127
  },
128
- "gitHead": "113c8a4b6dab529411fc03c05e630b179d76e5a1"
128
+ "gitHead": "cff4d7b347ef83af34d3f4ee2d55926df428ba3f"
129
129
  }
@@ -1,86 +0,0 @@
1
- import { writeSceneLog } from '../utils/writeSceneLog.js';
2
- import { captureNetwork } from './SceneRenderProfiler.js';
3
-
4
- var __typeError = (msg) => {
5
- throw TypeError(msg);
6
- };
7
- var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
8
- var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), member.get(obj));
9
- var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
- var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
11
- var _profileInProgress;
12
- class SceneInteractionProfiler {
13
- constructor() {
14
- this.queryController = null;
15
- this.isInteractionProfiler = true;
16
- __privateAdd(this, _profileInProgress, null);
17
- __privateSet(this, _profileInProgress, null);
18
- }
19
- setQueryController(queryController) {
20
- this.queryController = queryController;
21
- }
22
- startProfile(interaction) {
23
- if (__privateGet(this, _profileInProgress)) {
24
- this.cancelProfile();
25
- }
26
- __privateSet(this, _profileInProgress, {
27
- interaction,
28
- startTs: performance.now()
29
- });
30
- writeSceneLog("SceneInteractionProfiler", "Started profiling interaction:", interaction);
31
- }
32
- stopProfile() {
33
- var _a, _b;
34
- if (!__privateGet(this, _profileInProgress)) {
35
- return;
36
- }
37
- const endTs = performance.now();
38
- const interactionDuration = endTs - __privateGet(this, _profileInProgress).startTs;
39
- const networkDuration = captureNetwork(__privateGet(this, _profileInProgress).startTs, endTs);
40
- const result = {
41
- origin: __privateGet(this, _profileInProgress).interaction,
42
- duration: interactionDuration,
43
- networkDuration,
44
- startTs: __privateGet(this, _profileInProgress).startTs,
45
- endTs
46
- };
47
- writeSceneLog("SceneInteractionProfiler", "Completed profile:", result);
48
- if (((_a = this.queryController) == null ? void 0 : _a.state.onProfileComplete) && __privateGet(this, _profileInProgress)) {
49
- (_b = this.queryController) == null ? void 0 : _b.state.onProfileComplete(result);
50
- }
51
- performance.mark(`${__privateGet(this, _profileInProgress).interaction}_start`, {
52
- startTime: __privateGet(this, _profileInProgress).startTs
53
- });
54
- performance.mark(`${__privateGet(this, _profileInProgress).interaction}_end`, {
55
- startTime: endTs
56
- });
57
- performance.measure(
58
- `Interaction_${__privateGet(this, _profileInProgress).interaction}`,
59
- `${__privateGet(this, _profileInProgress).interaction}_start`,
60
- `${__privateGet(this, _profileInProgress).interaction}_end`
61
- );
62
- __privateSet(this, _profileInProgress, null);
63
- }
64
- cancelProfile() {
65
- if (__privateGet(this, _profileInProgress)) {
66
- writeSceneLog("SceneInteractionProfiler", "Cancelled profile:", __privateGet(this, _profileInProgress).interaction);
67
- __privateSet(this, _profileInProgress, null);
68
- }
69
- }
70
- isProfileActive() {
71
- return __privateGet(this, _profileInProgress) !== null;
72
- }
73
- getCurrentInteraction() {
74
- var _a, _b;
75
- return (_b = (_a = __privateGet(this, _profileInProgress)) == null ? void 0 : _a.interaction) != null ? _b : null;
76
- }
77
- }
78
- _profileInProgress = new WeakMap();
79
- const USER_INTERACTIONS = {
80
- ADHOC_KEYS_DROPDOWN: "adhoc_keys_dropdown",
81
- ADHOC_VALUES_DROPDOWN: "adhoc_values_dropdown",
82
- GROUPBY_DROPDOWN: "groupby_dropdown"
83
- };
84
-
85
- export { SceneInteractionProfiler, USER_INTERACTIONS };
86
- //# sourceMappingURL=SceneInteractionProfiler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SceneInteractionProfiler.js","sources":["../../../src/behaviors/SceneInteractionProfiler.ts"],"sourcesContent":["import { writeSceneLog } from '../utils/writeSceneLog';\nimport { captureNetwork } from './SceneRenderProfiler';\nimport { SceneInteractionProfileEvent, SceneQueryControllerLike } from './types';\n\nexport class SceneInteractionProfiler {\n private queryController: SceneQueryControllerLike | null = null;\n\n public isInteractionProfiler: true = true;\n #profileInProgress: {\n interaction: string;\n startTs: number;\n } | null = null;\n\n public constructor() {\n this.#profileInProgress = null;\n }\n\n public setQueryController(queryController: SceneQueryControllerLike) {\n this.queryController = queryController;\n }\n\n public startProfile(interaction: string) {\n // Cancel any existing profile\n if (this.#profileInProgress) {\n this.cancelProfile();\n }\n\n this.#profileInProgress = {\n interaction,\n startTs: performance.now(),\n };\n\n writeSceneLog('SceneInteractionProfiler', 'Started profiling interaction:', interaction);\n }\n\n public stopProfile() {\n if (!this.#profileInProgress) {\n return;\n }\n\n const endTs = performance.now();\n const interactionDuration = endTs - this.#profileInProgress.startTs;\n\n // Capture network requests that occurred during the interaction\n const networkDuration = captureNetwork(this.#profileInProgress.startTs, endTs);\n\n const result: SceneInteractionProfileEvent = {\n origin: this.#profileInProgress.interaction,\n duration: interactionDuration,\n networkDuration,\n startTs: this.#profileInProgress.startTs,\n endTs,\n };\n\n writeSceneLog('SceneInteractionProfiler', 'Completed profile:', result);\n\n if (this.queryController?.state.onProfileComplete && this.#profileInProgress) {\n this.queryController?.state.onProfileComplete(result);\n }\n\n // Create performance marks for browser dev tools\n performance.mark(`${this.#profileInProgress.interaction}_start`, {\n startTime: this.#profileInProgress.startTs,\n });\n performance.mark(`${this.#profileInProgress.interaction}_end`, {\n startTime: endTs,\n });\n performance.measure(\n `Interaction_${this.#profileInProgress.interaction}`,\n `${this.#profileInProgress.interaction}_start`,\n `${this.#profileInProgress.interaction}_end`\n );\n\n this.#profileInProgress = null;\n }\n\n private cancelProfile() {\n if (this.#profileInProgress) {\n writeSceneLog('SceneInteractionProfiler', 'Cancelled profile:', this.#profileInProgress.interaction);\n this.#profileInProgress = null;\n }\n }\n\n public isProfileActive(): boolean {\n return this.#profileInProgress !== null;\n }\n\n public getCurrentInteraction(): string | null {\n return this.#profileInProgress?.interaction ?? null;\n }\n}\n\n// Interaction constants for common use cases\nexport const USER_INTERACTIONS = {\n ADHOC_KEYS_DROPDOWN: 'adhoc_keys_dropdown',\n ADHOC_VALUES_DROPDOWN: 'adhoc_values_dropdown',\n GROUPBY_DROPDOWN: 'groupby_dropdown',\n} as const;\n"],"names":[],"mappings":";;;;;;;;;;AAAA,IAAA,kBAAA;AAIO,MAAM,wBAAyB,CAAA;AAAA,EAS7B,WAAc,GAAA;AARrB,IAAA,IAAA,CAAQ,eAAmD,GAAA,IAAA;AAE3D,IAAA,IAAA,CAAO,qBAA8B,GAAA,IAAA;AACrC,IAGW,YAAA,CAAA,IAAA,EAAA,kBAAA,EAAA,IAAA,CAAA;AAGT,IAAA,YAAA,CAAA,IAAA,EAAK,kBAAqB,EAAA,IAAA,CAAA;AAAA;AAC5B,EAEO,mBAAmB,eAA2C,EAAA;AACnE,IAAA,IAAA,CAAK,eAAkB,GAAA,eAAA;AAAA;AACzB,EAEO,aAAa,WAAqB,EAAA;AAEvC,IAAA,IAAI,mBAAK,kBAAoB,CAAA,EAAA;AAC3B,MAAA,IAAA,CAAK,aAAc,EAAA;AAAA;AAGrB,IAAA,YAAA,CAAA,IAAA,EAAK,kBAAqB,EAAA;AAAA,MACxB,WAAA;AAAA,MACA,OAAA,EAAS,YAAY,GAAI;AAAA,KAC3B,CAAA;AAEA,IAAc,aAAA,CAAA,0BAAA,EAA4B,kCAAkC,WAAW,CAAA;AAAA;AACzF,EAEO,WAAc,GAAA;AAnCvB,IAAA,IAA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