@grafana/scenes 5.7.5--canary.858.10369282107.0 → 5.7.5

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/scenes",
3
- "version": "5.7.5--canary.858.10369282107.0",
3
+ "version": "5.7.5",
4
4
  "description": "Grafana framework for building dynamic dashboards",
5
5
  "author": "Grafana Labs",
6
6
  "license": "AGPL-3.0-only",
@@ -113,5 +113,5 @@
113
113
  "prettier --write"
114
114
  ]
115
115
  },
116
- "gitHead": "674d7c73e3ef070b4c645ac40c0cd26e44996097"
116
+ "gitHead": "fc34fae5e0b8b85b2eea53215d5b13e047893358"
117
117
  }
@@ -1,171 +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 n = performance.now();
52
- const profileDuration = measurementStartTs - profileStartTs;
53
- writeSceneLog(
54
- this.constructor.name,
55
- "Stoped recording, total measured time (network included):",
56
- profileDuration + slowFramesTime
57
- );
58
- __privateSet(this, _trailAnimationFrameId, null);
59
- performance.measure("DashboardInteraction tail", {
60
- start: measurementStartTs,
61
- end: measurementStartTs + n
62
- });
63
- const profileEndTs = profileStartTs + profileDuration + slowFramesTime;
64
- performance.measure("DashboardInteraction", {
65
- start: profileStartTs,
66
- end: profileEndTs
67
- });
68
- const networkDuration = captureNetwork(profileStartTs, profileEndTs);
69
- if (this.queryController.state.onProfileComplete) {
70
- this.queryController.state.onProfileComplete({
71
- origin: __privateGet(this, _profileInProgress).origin,
72
- crumbs: __privateGet(this, _profileInProgress).crumbs,
73
- duration: profileDuration + slowFramesTime,
74
- networkDuration
75
- });
76
- }
77
- if (window.__runs) {
78
- window.__runs += `${Date.now()}, ${profileDuration + slowFramesTime}
79
- `;
80
- } else {
81
- window.__runs = `${Date.now()}, ${profileDuration + slowFramesTime}
82
- `;
83
- }
84
- }
85
- };
86
- }
87
- startProfile(name) {
88
- if (__privateGet(this, _trailAnimationFrameId)) {
89
- cancelAnimationFrame(__privateGet(this, _trailAnimationFrameId));
90
- __privateSet(this, _trailAnimationFrameId, null);
91
- writeSceneLog(this.constructor.name, "New profile: Stopped recording frames");
92
- }
93
- __privateSet(this, _profileInProgress, { origin: name, crumbs: [] });
94
- __privateSet(this, _profileStartTs, performance.now());
95
- writeSceneLog(this.constructor.name, "Profile started:", __privateGet(this, _profileInProgress), __privateGet(this, _profileStartTs));
96
- }
97
- recordProfileTail(measurementStartTime, profileStartTs) {
98
- __privateSet(this, _trailAnimationFrameId, requestAnimationFrame(
99
- () => this.measureTrailingFrames(measurementStartTime, measurementStartTime, profileStartTs)
100
- ));
101
- }
102
- tryCompletingProfile() {
103
- writeSceneLog(this.constructor.name, "Trying to complete profile", __privateGet(this, _profileInProgress));
104
- if (this.queryController.runningQueriesCount() === 0 && __privateGet(this, _profileInProgress)) {
105
- writeSceneLog(this.constructor.name, "All queries completed, stopping profile");
106
- this.recordProfileTail(performance.now(), __privateGet(this, _profileStartTs));
107
- }
108
- }
109
- isTailRecording() {
110
- return Boolean(__privateGet(this, _trailAnimationFrameId));
111
- }
112
- cancelTailRecording() {
113
- if (__privateGet(this, _trailAnimationFrameId)) {
114
- cancelAnimationFrame(__privateGet(this, _trailAnimationFrameId));
115
- __privateSet(this, _trailAnimationFrameId, null);
116
- writeSceneLog(this.constructor.name, "Cancelled recording frames, new profile started");
117
- }
118
- }
119
- addCrumb(crumb) {
120
- if (__privateGet(this, _profileInProgress)) {
121
- __privateGet(this, _profileInProgress).crumbs.push(crumb);
122
- }
123
- }
124
- }
125
- _profileInProgress = new WeakMap();
126
- _profileStartTs = new WeakMap();
127
- _trailAnimationFrameId = new WeakMap();
128
- _recordedTrailingSpans = new WeakMap();
129
- function processRecordedSpans(spans) {
130
- for (let i = spans.length - 1; i >= 0; i--) {
131
- if (spans[i] > SPAN_THRESHOLD) {
132
- return spans.slice(0, i + 1);
133
- }
134
- }
135
- return [spans[0]];
136
- }
137
- function captureNetwork(startTs, endTs) {
138
- const entries = performance.getEntriesByType("resource");
139
- performance.clearResourceTimings();
140
- const networkEntries = entries.filter((entry) => entry.startTime >= startTs && entry.startTime <= endTs);
141
- for (const entry of networkEntries) {
142
- performance.measure("Network entry " + entry.name, {
143
- start: entry.startTime,
144
- end: entry.responseEnd
145
- });
146
- }
147
- return calculateNetworkTime(networkEntries);
148
- }
149
- function calculateNetworkTime(requests) {
150
- if (requests.length === 0) {
151
- return 0;
152
- }
153
- requests.sort((a, b) => a.startTime - b.startTime);
154
- let totalNetworkTime = 0;
155
- let currentStart = requests[0].startTime;
156
- let currentEnd = requests[0].responseEnd;
157
- for (let i = 1; i < requests.length; i++) {
158
- if (requests[i].startTime <= currentEnd) {
159
- currentEnd = Math.max(currentEnd, requests[i].responseEnd);
160
- } else {
161
- totalNetworkTime += currentEnd - currentStart;
162
- currentStart = requests[i].startTime;
163
- currentEnd = requests[i].responseEnd;
164
- }
165
- }
166
- totalNetworkTime += currentEnd - currentStart;
167
- return totalNetworkTime;
168
- }
169
-
170
- export { SceneRenderProfiler };
171
- //# 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 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 // Using performance api to calculate sum of all network requests time starting at performance.now() -profileDuration - slowFramesTime\n // const entries = performance.getEntriesByType('resource');\n\n const n = performance.now();\n\n const profileDuration = measurementStartTs - profileStartTs;\n writeSceneLog(\n this.constructor.name,\n 'Stoped recording, total measured time (network included):',\n profileDuration + slowFramesTime\n );\n this.#trailAnimationFrameId = null;\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 });\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 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,EAAA,eAAA,EAAA,sBAAA,EAAA,sBAAA,CAAA;AAGA,MAAM,iBAAoB,GAAA,GAAA,CAAA;AAC1B,MAAM,cAAiB,GAAA,EAAA,CAAA;AAEhB,MAAM,mBAAoB,CAAA;AAAA,EAexB,YAAoB,eAA2C,EAAA;AAA3C,IAAA,IAAA,CAAA,eAAA,GAAA,eAAA,CAAA;AAd3B,IAIW,YAAA,CAAA,IAAA,EAAA,kBAAA,EAAA,IAAA,CAAA,CAAA;AAEX,IAAiC,YAAA,CAAA,IAAA,EAAA,eAAA,EAAA,IAAA,CAAA,CAAA;AACjC,IAAwC,YAAA,CAAA,IAAA,EAAA,sBAAA,EAAA,IAAA,CAAA,CAAA;AAGxC,IAAA,YAAA,CAAA,IAAA,EAAA,sBAAA,EAAmC,EAAC,CAAA,CAAA;AAEpC,IAAwB,IAAA,CAAA,aAAA,GAAA,CAAA,CAAA;AAuBxB,IAAA,IAAA,CAAQ,qBAAwB,GAAA,CAAC,kBAA4B,EAAA,aAAA,EAAuB,cAA2B,KAAA;AAC7G,MAAM,MAAA,gBAAA,GAAmB,YAAY,GAAI,EAAA,CAAA;AACzC,MAAA,MAAM,cAAc,gBAAmB,GAAA,aAAA,CAAA;AACvC,MAAK,YAAA,CAAA,IAAA,EAAA,sBAAA,CAAA,CAAuB,KAAK,WAAW,CAAA,CAAA;AAE5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
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;;;;"}