@grafana/scenes 5.23.1--canary.858.11699916776.0 → 5.23.1--canary.955.11702691002.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. package/CHANGELOG.md +6 -6
  2. package/dist/esm/behaviors/SceneQueryController.js +5 -60
  3. package/dist/esm/behaviors/SceneQueryController.js.map +1 -1
  4. package/dist/esm/components/SceneRefreshPicker.js +1 -4
  5. package/dist/esm/components/SceneRefreshPicker.js.map +1 -1
  6. package/dist/esm/components/VizPanel/VizPanel.js +6 -9
  7. package/dist/esm/components/VizPanel/VizPanel.js.map +1 -1
  8. package/dist/esm/core/SceneTimeRange.js +0 -3
  9. package/dist/esm/core/SceneTimeRange.js.map +1 -1
  10. package/dist/esm/core/sceneGraph/index.js +3 -3
  11. package/dist/esm/core/sceneGraph/index.js.map +1 -1
  12. package/dist/esm/core/sceneGraph/sceneGraph.js +26 -1
  13. package/dist/esm/core/sceneGraph/sceneGraph.js.map +1 -1
  14. package/dist/esm/index.js.map +1 -1
  15. package/dist/esm/querying/SceneQueryRunner.js +3 -1
  16. package/dist/esm/querying/SceneQueryRunner.js.map +1 -1
  17. package/dist/esm/querying/registerQueryWithController.js +2 -19
  18. package/dist/esm/querying/registerQueryWithController.js.map +1 -1
  19. package/dist/esm/utils/getDataSource.js +1 -17
  20. package/dist/esm/utils/getDataSource.js.map +1 -1
  21. package/dist/esm/variables/adhoc/AdHocFilterRenderer.js +8 -12
  22. package/dist/esm/variables/adhoc/AdHocFilterRenderer.js.map +1 -1
  23. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFilterPill.js +14 -2
  24. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFilterPill.js.map +1 -1
  25. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.js +46 -58
  26. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.js.map +1 -1
  27. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/MultiValuePill.js +114 -0
  28. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/MultiValuePill.js.map +1 -0
  29. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/utils.js +14 -1
  30. package/dist/esm/variables/adhoc/AdHocFiltersCombobox/utils.js.map +1 -1
  31. package/dist/esm/variables/adhoc/AdHocFiltersVariableUrlSyncHandler.js +4 -1
  32. package/dist/esm/variables/adhoc/AdHocFiltersVariableUrlSyncHandler.js.map +1 -1
  33. package/dist/esm/variables/components/VariableValueSelect.js +0 -5
  34. package/dist/esm/variables/components/VariableValueSelect.js.map +1 -1
  35. package/dist/esm/variables/utils.js.map +1 -1
  36. package/dist/esm/variables/variants/MultiValueVariable.js.map +1 -1
  37. package/dist/esm/variables/variants/TestVariable.js.map +1 -1
  38. package/dist/index.d.ts +32 -44
  39. package/dist/index.js +471 -600
  40. package/dist/index.js.map +1 -1
  41. package/package.json +2 -2
  42. package/dist/esm/behaviors/SceneRenderProfiler.js +0 -169
  43. package/dist/esm/behaviors/SceneRenderProfiler.js.map +0 -1
  44. package/dist/esm/core/sceneGraph/getQueryController.js +0 -19
  45. package/dist/esm/core/sceneGraph/getQueryController.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/scenes",
3
- "version": "5.23.1--canary.858.11699916776.0",
3
+ "version": "5.23.1--canary.955.11702691002.0",
4
4
  "description": "Grafana framework for building dynamic dashboards",
5
5
  "author": "Grafana Labs",
6
6
  "license": "AGPL-3.0-only",
@@ -115,5 +115,5 @@
115
115
  "prettier --write"
116
116
  ]
117
117
  },
118
- "gitHead": "edf8cd7459effbcd34c60791cccfca9b7ed2f2cf"
118
+ "gitHead": "ac12ad4f6030e2e227ade3ba92ffd1530ed67d7a"
119
119
  }
@@ -1,169 +0,0 @@
1
- import { writeSceneLog } from '../utils/writeSceneLog.js';
2
-
3
- var __accessCheck = (obj, member, msg) => {
4
- if (!member.has(obj))
5
- throw TypeError("Cannot " + msg);
6
- };
7
- var __privateGet = (obj, member, getter) => {
8
- __accessCheck(obj, member, "read from private field");
9
- return getter ? getter.call(obj) : member.get(obj);
10
- };
11
- var __privateAdd = (obj, member, value) => {
12
- if (member.has(obj))
13
- throw TypeError("Cannot add the same private member more than once");
14
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
15
- };
16
- var __privateSet = (obj, member, value, setter) => {
17
- __accessCheck(obj, member, "write to private field");
18
- setter ? setter.call(obj, value) : member.set(obj, value);
19
- return value;
20
- };
21
- var _profileInProgress, _profileStartTs, _trailAnimationFrameId, _recordedTrailingSpans;
22
- const POST_STORM_WINDOW = 2e3;
23
- const SPAN_THRESHOLD = 30;
24
- class SceneRenderProfiler {
25
- constructor(queryController) {
26
- this.queryController = queryController;
27
- __privateAdd(this, _profileInProgress, null);
28
- __privateAdd(this, _profileStartTs, null);
29
- __privateAdd(this, _trailAnimationFrameId, null);
30
- __privateAdd(this, _recordedTrailingSpans, []);
31
- this.lastFrameTime = 0;
32
- this.measureTrailingFrames = (measurementStartTs, lastFrameTime, profileStartTs) => {
33
- const currentFrameTime = performance.now();
34
- const frameLength = currentFrameTime - lastFrameTime;
35
- __privateGet(this, _recordedTrailingSpans).push(frameLength);
36
- if (currentFrameTime - measurementStartTs < POST_STORM_WINDOW) {
37
- __privateSet(this, _trailAnimationFrameId, requestAnimationFrame(
38
- () => this.measureTrailingFrames(measurementStartTs, currentFrameTime, profileStartTs)
39
- ));
40
- } else {
41
- const slowFrames = processRecordedSpans(__privateGet(this, _recordedTrailingSpans));
42
- const slowFramesTime = slowFrames.reduce((acc, val) => acc + val, 0);
43
- writeSceneLog(
44
- this.constructor.name,
45
- "Profile tail recorded, slow frames duration:",
46
- slowFramesTime,
47
- slowFrames,
48
- __privateGet(this, _profileInProgress)
49
- );
50
- __privateSet(this, _recordedTrailingSpans, []);
51
- const profileDuration = measurementStartTs - profileStartTs;
52
- writeSceneLog(
53
- this.constructor.name,
54
- "Stoped recording, total measured time (network included):",
55
- profileDuration + slowFramesTime
56
- );
57
- __privateSet(this, _trailAnimationFrameId, null);
58
- const profileEndTs = profileStartTs + profileDuration + slowFramesTime;
59
- performance.measure("DashboardInteraction", {
60
- start: profileStartTs,
61
- end: profileEndTs
62
- });
63
- const networkDuration = captureNetwork(profileStartTs, profileEndTs);
64
- if (this.queryController.state.onProfileComplete) {
65
- this.queryController.state.onProfileComplete({
66
- origin: __privateGet(this, _profileInProgress).origin,
67
- crumbs: __privateGet(this, _profileInProgress).crumbs,
68
- duration: profileDuration + slowFramesTime,
69
- networkDuration,
70
- jsHeapSizeLimit: performance.memory ? performance.memory.jsHeapSizeLimit : 0,
71
- usedJSHeapSize: performance.memory ? performance.memory.usedJSHeapSize : 0,
72
- totalJSHeapSize: performance.memory ? performance.memory.totalJSHeapSize : 0
73
- });
74
- }
75
- if (window.__runs) {
76
- window.__runs += `${Date.now()}, ${profileDuration + slowFramesTime}
77
- `;
78
- } else {
79
- window.__runs = `${Date.now()}, ${profileDuration + slowFramesTime}
80
- `;
81
- }
82
- }
83
- };
84
- }
85
- startProfile(name) {
86
- if (__privateGet(this, _trailAnimationFrameId)) {
87
- cancelAnimationFrame(__privateGet(this, _trailAnimationFrameId));
88
- __privateSet(this, _trailAnimationFrameId, null);
89
- writeSceneLog(this.constructor.name, "New profile: Stopped recording frames");
90
- }
91
- __privateSet(this, _profileInProgress, { origin: name, crumbs: [] });
92
- __privateSet(this, _profileStartTs, performance.now());
93
- writeSceneLog(this.constructor.name, "Profile started:", __privateGet(this, _profileInProgress), __privateGet(this, _profileStartTs));
94
- }
95
- recordProfileTail(measurementStartTime, profileStartTs) {
96
- __privateSet(this, _trailAnimationFrameId, requestAnimationFrame(
97
- () => this.measureTrailingFrames(measurementStartTime, measurementStartTime, profileStartTs)
98
- ));
99
- }
100
- tryCompletingProfile() {
101
- writeSceneLog(this.constructor.name, "Trying to complete profile", __privateGet(this, _profileInProgress));
102
- if (this.queryController.runningQueriesCount() === 0 && __privateGet(this, _profileInProgress)) {
103
- writeSceneLog(this.constructor.name, "All queries completed, stopping profile");
104
- this.recordProfileTail(performance.now(), __privateGet(this, _profileStartTs));
105
- }
106
- }
107
- isTailRecording() {
108
- return Boolean(__privateGet(this, _trailAnimationFrameId));
109
- }
110
- cancelTailRecording() {
111
- if (__privateGet(this, _trailAnimationFrameId)) {
112
- cancelAnimationFrame(__privateGet(this, _trailAnimationFrameId));
113
- __privateSet(this, _trailAnimationFrameId, null);
114
- writeSceneLog(this.constructor.name, "Cancelled recording frames, new profile started");
115
- }
116
- }
117
- addCrumb(crumb) {
118
- if (__privateGet(this, _profileInProgress)) {
119
- __privateGet(this, _profileInProgress).crumbs.push(crumb);
120
- }
121
- }
122
- }
123
- _profileInProgress = new WeakMap();
124
- _profileStartTs = new WeakMap();
125
- _trailAnimationFrameId = new WeakMap();
126
- _recordedTrailingSpans = new WeakMap();
127
- function processRecordedSpans(spans) {
128
- for (let i = spans.length - 1; i >= 0; i--) {
129
- if (spans[i] > SPAN_THRESHOLD) {
130
- return spans.slice(0, i + 1);
131
- }
132
- }
133
- return [spans[0]];
134
- }
135
- function captureNetwork(startTs, endTs) {
136
- const entries = performance.getEntriesByType("resource");
137
- performance.clearResourceTimings();
138
- const networkEntries = entries.filter((entry) => entry.startTime >= startTs && entry.startTime <= endTs);
139
- for (const entry of networkEntries) {
140
- performance.measure("Network entry " + entry.name, {
141
- start: entry.startTime,
142
- end: entry.responseEnd
143
- });
144
- }
145
- return calculateNetworkTime(networkEntries);
146
- }
147
- function calculateNetworkTime(requests) {
148
- if (requests.length === 0) {
149
- return 0;
150
- }
151
- requests.sort((a, b) => a.startTime - b.startTime);
152
- let totalNetworkTime = 0;
153
- let currentStart = requests[0].startTime;
154
- let currentEnd = requests[0].responseEnd;
155
- for (let i = 1; i < requests.length; i++) {
156
- if (requests[i].startTime <= currentEnd) {
157
- currentEnd = Math.max(currentEnd, requests[i].responseEnd);
158
- } else {
159
- totalNetworkTime += currentEnd - currentStart;
160
- currentStart = requests[i].startTime;
161
- currentEnd = requests[i].responseEnd;
162
- }
163
- }
164
- totalNetworkTime += currentEnd - currentStart;
165
- return totalNetworkTime;
166
- }
167
-
168
- export { SceneRenderProfiler };
169
- //# sourceMappingURL=SceneRenderProfiler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SceneRenderProfiler.js","sources":["../../../src/behaviors/SceneRenderProfiler.ts"],"sourcesContent":["import { writeSceneLog } from '../utils/writeSceneLog';\nimport { SceneQueryControllerLike } from './types';\n\nconst POST_STORM_WINDOW = 2000; // Time after last query to observe slow frames\nconst SPAN_THRESHOLD = 30; // Frames longer than this will be considered slow\n\nexport class SceneRenderProfiler {\n #profileInProgress: {\n // Profile origin, i.e. scene refresh picker\n origin: string;\n crumbs: string[];\n } | null = null;\n\n #profileStartTs: number | null = null;\n #trailAnimationFrameId: number | null = null;\n\n // Will keep measured lengths trailing frames\n #recordedTrailingSpans: number[] = [];\n\n lastFrameTime: number = 0;\n\n public constructor(private queryController: SceneQueryControllerLike) {}\n\n public startProfile(name: string) {\n if (this.#trailAnimationFrameId) {\n cancelAnimationFrame(this.#trailAnimationFrameId);\n this.#trailAnimationFrameId = null;\n\n writeSceneLog(this.constructor.name, 'New profile: Stopped recording frames');\n }\n\n this.#profileInProgress = { origin: name, crumbs: [] };\n this.#profileStartTs = performance.now();\n writeSceneLog(this.constructor.name, 'Profile started:', this.#profileInProgress, this.#profileStartTs);\n }\n\n private recordProfileTail(measurementStartTime: number, profileStartTs: number) {\n this.#trailAnimationFrameId = requestAnimationFrame(() =>\n this.measureTrailingFrames(measurementStartTime, measurementStartTime, profileStartTs)\n );\n }\n\n private measureTrailingFrames = (measurementStartTs: number, lastFrameTime: number, profileStartTs: number) => {\n const currentFrameTime = performance.now();\n const frameLength = currentFrameTime - lastFrameTime;\n this.#recordedTrailingSpans.push(frameLength);\n\n if (currentFrameTime - measurementStartTs! < POST_STORM_WINDOW) {\n this.#trailAnimationFrameId = requestAnimationFrame(() =>\n this.measureTrailingFrames(measurementStartTs, currentFrameTime, profileStartTs)\n );\n } else {\n const slowFrames = processRecordedSpans(this.#recordedTrailingSpans);\n const slowFramesTime = slowFrames.reduce((acc, val) => acc + val, 0);\n\n writeSceneLog(\n this.constructor.name,\n 'Profile tail recorded, slow frames duration:',\n slowFramesTime,\n slowFrames,\n this.#profileInProgress\n );\n\n this.#recordedTrailingSpans = [];\n\n const profileDuration = measurementStartTs - profileStartTs;\n\n writeSceneLog(\n this.constructor.name,\n 'Stoped recording, total measured time (network included):',\n profileDuration + slowFramesTime\n );\n this.#trailAnimationFrameId = null;\n\n // performance.measure('DashboardInteraction tail', {\n // start: measurementStartTs,\n // end: measurementStartTs + n,\n // });\n\n const profileEndTs = profileStartTs + profileDuration + slowFramesTime;\n\n performance.measure('DashboardInteraction', {\n start: profileStartTs,\n end: profileEndTs,\n });\n\n const networkDuration = captureNetwork(profileStartTs, profileEndTs);\n\n if (this.queryController.state.onProfileComplete) {\n this.queryController.state.onProfileComplete({\n origin: this.#profileInProgress!.origin,\n crumbs: this.#profileInProgress!.crumbs,\n duration: profileDuration + slowFramesTime,\n networkDuration,\n // @ts-ignore\n jsHeapSizeLimit: performance.memory ? performance.memory.jsHeapSizeLimit : 0,\n // @ts-ignore\n usedJSHeapSize: performance.memory ? performance.memory.usedJSHeapSize : 0,\n // @ts-ignore\n totalJSHeapSize: performance.memory ? performance.memory.totalJSHeapSize : 0,\n });\n }\n // @ts-ignore\n if (window.__runs) {\n // @ts-ignore\n window.__runs += `${Date.now()}, ${profileDuration + slowFramesTime}\\n`;\n } else {\n // @ts-ignore\n window.__runs = `${Date.now()}, ${profileDuration + slowFramesTime}\\n`;\n }\n }\n };\n\n public tryCompletingProfile() {\n writeSceneLog(this.constructor.name, 'Trying to complete profile', this.#profileInProgress);\n\n if (this.queryController.runningQueriesCount() === 0 && this.#profileInProgress) {\n writeSceneLog(this.constructor.name, 'All queries completed, stopping profile');\n this.recordProfileTail(performance.now(), this.#profileStartTs!);\n }\n }\n\n public isTailRecording() {\n return Boolean(this.#trailAnimationFrameId);\n }\n public cancelTailRecording() {\n if (this.#trailAnimationFrameId) {\n cancelAnimationFrame(this.#trailAnimationFrameId);\n this.#trailAnimationFrameId = null;\n writeSceneLog(this.constructor.name, 'Cancelled recording frames, new profile started');\n }\n }\n\n public addCrumb(crumb: string) {\n if (this.#profileInProgress) {\n this.#profileInProgress.crumbs.push(crumb);\n }\n }\n}\n\nfunction processRecordedSpans(spans: number[]) {\n // identifie last span in spans that's bigger than 50\n for (let i = spans.length - 1; i >= 0; i--) {\n if (spans[i] > SPAN_THRESHOLD) {\n return spans.slice(0, i + 1);\n }\n }\n return [spans[0]];\n}\n\nfunction captureNetwork(startTs: number, endTs: number) {\n const entries = performance.getEntriesByType('resource');\n performance.clearResourceTimings();\n const networkEntries = entries.filter((entry) => entry.startTime >= startTs && entry.startTime <= endTs);\n for (const entry of networkEntries) {\n performance.measure('Network entry ' + entry.name, {\n start: entry.startTime,\n end: entry.responseEnd,\n });\n }\n\n return calculateNetworkTime(networkEntries);\n}\n\n// Will calculate total time spent on Network\nfunction calculateNetworkTime(requests: PerformanceResourceTiming[]): number {\n if (requests.length === 0) {\n return 0;\n }\n\n // Step 1: Sort the requests by startTs\n requests.sort((a, b) => a.startTime - b.startTime);\n\n // Step 2: Initialize variables\n let totalNetworkTime = 0;\n let currentStart = requests[0].startTime;\n let currentEnd = requests[0].responseEnd;\n\n // Step 3: Iterate through the sorted list and merge overlapping intervals\n for (let i = 1; i < requests.length; i++) {\n if (requests[i].startTime <= currentEnd) {\n // Overlapping intervals, merge them\n currentEnd = Math.max(currentEnd, requests[i].responseEnd);\n } else {\n // Non-overlapping interval, add the duration to total time\n totalNetworkTime += currentEnd - currentStart;\n\n // Update current interval\n currentStart = requests[i].startTime;\n currentEnd = requests[i].responseEnd;\n }\n }\n\n // Step 4: Add the last interval\n totalNetworkTime += currentEnd - currentStart;\n\n return totalNetworkTime;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,IAAA,kBAAA,EAA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AA,CAAS,KAAK,CAAC,CAAA,EAAG,MAAM,CAAE,CAAA,SAAA,GAAY,EAAE,SAAS,CAAA,CAAA;AAGjD,EAAA,IAAI,gBAAmB,GAAA,CAAA,CAAA;AACvB,EAAI,IAAA,YAAA,GAAe,SAAS,CAAG,CAAA,CAAA,SAAA,CAAA;AAC/B,EAAI,IAAA,UAAA,GAAa,SAAS,CAAG,CAAA,CAAA,WAAA,CAAA;AAG7B,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,QAAA,CAAS,QAAQ,CAAK,EAAA,EAAA;AACxC,IAAI,IAAA,QAAA,CAAS,CAAG,CAAA,CAAA,SAAA,IAAa,UAAY,EAAA;AAEvC,MAAA,UAAA,GAAa,IAAK,CAAA,GAAA,CAAI,UAAY,EAAA,QAAA,CAAS,GAAG,WAAW,CAAA,CAAA;AAAA,KACpD,MAAA;AAEL,MAAA,gBAAA,IAAoB,UAAa,GAAA,YAAA,CAAA;AAGjC,MAAA,YAAA,GAAe,SAAS,CAAG,CAAA,CAAA,SAAA,CAAA;AAC3B,MAAA,UAAA,GAAa,SAAS,CAAG,CAAA,CAAA,WAAA,CAAA;AAAA,KAC3B;AAAA,GACF;AAGA,EAAA,gBAAA,IAAoB,UAAa,GAAA,YAAA,CAAA;AAEjC,EAAO,OAAA,gBAAA,CAAA;AACT;;;;"}
@@ -1,19 +0,0 @@
1
- import { isQueryController } from '../../behaviors/SceneQueryController.js';
2
-
3
- function getQueryController(sceneObject) {
4
- let parent = sceneObject;
5
- while (parent) {
6
- if (parent.state.$behaviors) {
7
- for (const behavior of parent.state.$behaviors) {
8
- if (isQueryController(behavior)) {
9
- return behavior;
10
- }
11
- }
12
- }
13
- parent = parent.parent;
14
- }
15
- return void 0;
16
- }
17
-
18
- export { getQueryController };
19
- //# sourceMappingURL=getQueryController.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getQueryController.js","sources":["../../../../src/core/sceneGraph/getQueryController.ts"],"sourcesContent":["import { isQueryController } from '../../behaviors/SceneQueryController';\nimport { SceneQueryControllerLike } from '../../behaviors/types';\nimport { SceneObject } from '../types';\n\n/**\n * Returns the closest query controller undefined if none found\n */\nexport function getQueryController(sceneObject: SceneObject): SceneQueryControllerLike | undefined {\n let parent: SceneObject | undefined = sceneObject;\n\n while (parent) {\n if (parent.state.$behaviors) {\n for (const behavior of parent.state.$behaviors) {\n if (isQueryController(behavior)) {\n return behavior;\n }\n }\n }\n parent = parent.parent;\n }\n\n return undefined;\n}\n"],"names":[],"mappings":";;AAOO,SAAS,mBAAmB,WAAgE,EAAA;AACjG,EAAA,IAAI,MAAkC,GAAA,WAAA,CAAA;AAEtC,EAAA,OAAO,MAAQ,EAAA;AACb,IAAI,IAAA,MAAA,CAAO,MAAM,UAAY,EAAA;AAC3B,MAAW,KAAA,MAAA,QAAA,IAAY,MAAO,CAAA,KAAA,CAAM,UAAY,EAAA;AAC9C,QAAI,IAAA,iBAAA,CAAkB,QAAQ,CAAG,EAAA;AAC/B,UAAO,OAAA,QAAA,CAAA;AAAA,SACT;AAAA,OACF;AAAA,KACF;AACA,IAAA,MAAA,GAAS,MAAO,CAAA,MAAA,CAAA;AAAA,GAClB;AAEA,EAAO,OAAA,KAAA,CAAA,CAAA;AACT;;;;"}