@grafana/scenes 6.35.2 → 6.36.0--canary.1240.17760349466.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/CHANGELOG.md +14 -0
- package/dist/esm/behaviors/SceneInteractionProfiler.js +86 -0
- package/dist/esm/behaviors/SceneInteractionProfiler.js.map +1 -0
- package/dist/esm/behaviors/SceneQueryController.js +30 -13
- package/dist/esm/behaviors/SceneQueryController.js.map +1 -1
- package/dist/esm/components/VizPanel/VizPanelRenderer.js +8 -1
- package/dist/esm/components/VizPanel/VizPanelRenderer.js.map +1 -1
- package/dist/esm/components/layout/LazyLoader.js +6 -2
- package/dist/esm/components/layout/LazyLoader.js.map +1 -1
- package/dist/esm/core/types.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/querying/SceneDataTransformer.js +8 -0
- package/dist/esm/querying/SceneDataTransformer.js.map +1 -1
- package/dist/esm/querying/SceneQueryRunner.js +22 -0
- package/dist/esm/querying/SceneQueryRunner.js.map +1 -1
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.js +8 -0
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.js.map +1 -1
- package/dist/esm/variables/groupby/GroupByVariable.js +8 -0
- package/dist/esm/variables/groupby/GroupByVariable.js.map +1 -1
- package/dist/index.d.ts +43 -9
- package/dist/index.js +377 -225
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -137,21 +137,21 @@ class UserActionEvent extends data.BusEventWithPayload {
|
|
|
137
137
|
}
|
|
138
138
|
UserActionEvent.type = "scene-object-user-action";
|
|
139
139
|
|
|
140
|
-
var __typeError$
|
|
140
|
+
var __typeError$6 = (msg) => {
|
|
141
141
|
throw TypeError(msg);
|
|
142
142
|
};
|
|
143
|
-
var __accessCheck$
|
|
144
|
-
var __privateGet$
|
|
145
|
-
var __privateAdd$
|
|
146
|
-
var __privateSet$
|
|
143
|
+
var __accessCheck$6 = (obj, member, msg) => member.has(obj) || __typeError$6("Cannot " + msg);
|
|
144
|
+
var __privateGet$6 = (obj, member, getter) => (__accessCheck$6(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
145
|
+
var __privateAdd$6 = (obj, member, value) => member.has(obj) ? __typeError$6("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
146
|
+
var __privateSet$6 = (obj, member, value, setter) => (__accessCheck$6(obj, member, "write to private field"), member.set(obj, value), value);
|
|
147
147
|
var _ref;
|
|
148
148
|
class SceneObjectRef {
|
|
149
149
|
constructor(ref) {
|
|
150
|
-
__privateAdd$
|
|
151
|
-
__privateSet$
|
|
150
|
+
__privateAdd$6(this, _ref);
|
|
151
|
+
__privateSet$6(this, _ref, ref);
|
|
152
152
|
}
|
|
153
153
|
resolve() {
|
|
154
|
-
return __privateGet$
|
|
154
|
+
return __privateGet$6(this, _ref);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
_ref = new WeakMap();
|
|
@@ -609,62 +609,79 @@ function writeSceneLogStyled(logger, message, style, ...rest) {
|
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
611
|
|
|
612
|
-
var __typeError$
|
|
612
|
+
var __typeError$5 = (msg) => {
|
|
613
613
|
throw TypeError(msg);
|
|
614
614
|
};
|
|
615
|
-
var __accessCheck$
|
|
616
|
-
var __privateGet$
|
|
617
|
-
var __privateAdd$
|
|
618
|
-
var __privateSet$
|
|
615
|
+
var __accessCheck$5 = (obj, member, msg) => member.has(obj) || __typeError$5("Cannot " + msg);
|
|
616
|
+
var __privateGet$5 = (obj, member, getter) => (__accessCheck$5(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
617
|
+
var __privateAdd$5 = (obj, member, value) => member.has(obj) ? __typeError$5("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
618
|
+
var __privateSet$5 = (obj, member, value, setter) => (__accessCheck$5(obj, member, "write to private field"), member.set(obj, value), value);
|
|
619
619
|
var _running, _tryCompleteProfileFrameId;
|
|
620
620
|
function isQueryController(s) {
|
|
621
621
|
return "isQueryController" in s;
|
|
622
622
|
}
|
|
623
623
|
class SceneQueryController extends SceneObjectBase {
|
|
624
|
-
constructor(state = {},
|
|
624
|
+
constructor(state = {}, renderProfiler, interactionProfiler) {
|
|
625
625
|
super({ ...state, isRunning: false });
|
|
626
|
-
this.
|
|
626
|
+
this.renderProfiler = renderProfiler;
|
|
627
|
+
this.interactionProfiler = interactionProfiler;
|
|
627
628
|
this.isQueryController = true;
|
|
628
|
-
__privateAdd$
|
|
629
|
-
__privateAdd$
|
|
629
|
+
__privateAdd$5(this, _running, /* @__PURE__ */ new Set());
|
|
630
|
+
__privateAdd$5(this, _tryCompleteProfileFrameId, null);
|
|
630
631
|
this.runningQueriesCount = () => {
|
|
631
|
-
return __privateGet$
|
|
632
|
+
return __privateGet$5(this, _running).size;
|
|
632
633
|
};
|
|
633
|
-
if (
|
|
634
|
-
this.
|
|
635
|
-
|
|
634
|
+
if (renderProfiler) {
|
|
635
|
+
this.renderProfiler = renderProfiler;
|
|
636
|
+
renderProfiler.setQueryController(this);
|
|
637
|
+
}
|
|
638
|
+
if (interactionProfiler) {
|
|
639
|
+
this.interactionProfiler = interactionProfiler;
|
|
640
|
+
interactionProfiler.setQueryController(this);
|
|
636
641
|
}
|
|
637
642
|
this.addActivationHandler(() => {
|
|
638
|
-
var _a;
|
|
639
|
-
(_a = this.
|
|
640
|
-
|
|
643
|
+
var _a, _b;
|
|
644
|
+
(_a = this.renderProfiler) == null ? void 0 : _a.setQueryController(this);
|
|
645
|
+
(_b = this.interactionProfiler) == null ? void 0 : _b.setQueryController(this);
|
|
646
|
+
return () => __privateGet$5(this, _running).clear();
|
|
641
647
|
});
|
|
642
648
|
}
|
|
649
|
+
startInteractionProfile(name) {
|
|
650
|
+
var _a;
|
|
651
|
+
if (!this.state.enableProfiling) {
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
(_a = this.interactionProfiler) == null ? void 0 : _a.startProfile(name);
|
|
655
|
+
}
|
|
656
|
+
stopInteractionProfile() {
|
|
657
|
+
var _a;
|
|
658
|
+
(_a = this.interactionProfiler) == null ? void 0 : _a.stopProfile();
|
|
659
|
+
}
|
|
643
660
|
startProfile(name) {
|
|
644
661
|
var _a;
|
|
645
662
|
if (!this.state.enableProfiling) {
|
|
646
663
|
return;
|
|
647
664
|
}
|
|
648
|
-
(_a = this.
|
|
665
|
+
(_a = this.renderProfiler) == null ? void 0 : _a.startProfile(name);
|
|
649
666
|
}
|
|
650
667
|
cancelProfile() {
|
|
651
668
|
var _a;
|
|
652
|
-
(_a = this.
|
|
669
|
+
(_a = this.renderProfiler) == null ? void 0 : _a.cancelProfile();
|
|
653
670
|
}
|
|
654
671
|
queryStarted(entry) {
|
|
655
|
-
__privateGet$
|
|
672
|
+
__privateGet$5(this, _running).add(entry);
|
|
656
673
|
this.changeRunningQueryCount(1, entry);
|
|
657
674
|
if (!this.state.isRunning) {
|
|
658
675
|
this.setState({ isRunning: true });
|
|
659
676
|
}
|
|
660
677
|
}
|
|
661
678
|
queryCompleted(entry) {
|
|
662
|
-
if (!__privateGet$
|
|
679
|
+
if (!__privateGet$5(this, _running).has(entry)) {
|
|
663
680
|
return;
|
|
664
681
|
}
|
|
665
|
-
__privateGet$
|
|
682
|
+
__privateGet$5(this, _running).delete(entry);
|
|
666
683
|
this.changeRunningQueryCount(-1);
|
|
667
|
-
if (__privateGet$
|
|
684
|
+
if (__privateGet$5(this, _running).size === 0) {
|
|
668
685
|
this.setState({ isRunning: false });
|
|
669
686
|
}
|
|
670
687
|
}
|
|
@@ -673,26 +690,26 @@ class SceneQueryController extends SceneObjectBase {
|
|
|
673
690
|
window.__grafanaRunningQueryCount = ((_a = window.__grafanaRunningQueryCount) != null ? _a : 0) + dir;
|
|
674
691
|
if (dir === 1 && this.state.enableProfiling) {
|
|
675
692
|
if (entry) {
|
|
676
|
-
(_b = this.
|
|
693
|
+
(_b = this.renderProfiler) == null ? void 0 : _b.addCrumb(`${entry.type}`);
|
|
677
694
|
}
|
|
678
|
-
if ((_c = this.
|
|
695
|
+
if ((_c = this.renderProfiler) == null ? void 0 : _c.isTailRecording()) {
|
|
679
696
|
writeSceneLog("SceneQueryController", "New query started, cancelling tail recording");
|
|
680
|
-
(_d = this.
|
|
697
|
+
(_d = this.renderProfiler) == null ? void 0 : _d.cancelTailRecording();
|
|
681
698
|
}
|
|
682
699
|
}
|
|
683
700
|
if (this.state.enableProfiling) {
|
|
684
|
-
if (__privateGet$
|
|
685
|
-
cancelAnimationFrame(__privateGet$
|
|
701
|
+
if (__privateGet$5(this, _tryCompleteProfileFrameId)) {
|
|
702
|
+
cancelAnimationFrame(__privateGet$5(this, _tryCompleteProfileFrameId));
|
|
686
703
|
}
|
|
687
|
-
__privateSet$
|
|
704
|
+
__privateSet$5(this, _tryCompleteProfileFrameId, requestAnimationFrame(() => {
|
|
688
705
|
var _a2;
|
|
689
|
-
(_a2 = this.
|
|
706
|
+
(_a2 = this.renderProfiler) == null ? void 0 : _a2.tryCompletingProfile();
|
|
690
707
|
}));
|
|
691
708
|
}
|
|
692
709
|
}
|
|
693
710
|
cancelAll() {
|
|
694
711
|
var _a;
|
|
695
|
-
for (const entry of __privateGet$
|
|
712
|
+
for (const entry of __privateGet$5(this, _running).values()) {
|
|
696
713
|
(_a = entry.cancel) == null ? void 0 : _a.call(entry);
|
|
697
714
|
}
|
|
698
715
|
}
|
|
@@ -862,41 +879,41 @@ function isValid$1(value, roundUp, timeZone) {
|
|
|
862
879
|
return parsed.isValid();
|
|
863
880
|
}
|
|
864
881
|
|
|
865
|
-
var __typeError$
|
|
882
|
+
var __typeError$4 = (msg) => {
|
|
866
883
|
throw TypeError(msg);
|
|
867
884
|
};
|
|
868
|
-
var __accessCheck$
|
|
869
|
-
var __privateGet$
|
|
870
|
-
var __privateAdd$
|
|
871
|
-
var __privateSet$
|
|
885
|
+
var __accessCheck$4 = (obj, member, msg) => member.has(obj) || __typeError$4("Cannot " + msg);
|
|
886
|
+
var __privateGet$4 = (obj, member, getter) => (__accessCheck$4(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
887
|
+
var __privateAdd$4 = (obj, member, value) => member.has(obj) ? __typeError$4("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
888
|
+
var __privateSet$4 = (obj, member, value, setter) => (__accessCheck$4(obj, member, "write to private field"), member.set(obj, value), value);
|
|
872
889
|
var _isTracking, _callback, _frameTrackingId, _lastFrameTime, _loafObserver;
|
|
873
890
|
const LONG_FRAME_THRESHOLD = 50;
|
|
874
891
|
class LongFrameDetector {
|
|
875
892
|
constructor() {
|
|
876
|
-
__privateAdd$
|
|
877
|
-
__privateAdd$
|
|
893
|
+
__privateAdd$4(this, _isTracking, false);
|
|
894
|
+
__privateAdd$4(this, _callback, null);
|
|
878
895
|
// Manual tracking state
|
|
879
|
-
__privateAdd$
|
|
880
|
-
__privateAdd$
|
|
896
|
+
__privateAdd$4(this, _frameTrackingId, null);
|
|
897
|
+
__privateAdd$4(this, _lastFrameTime, 0);
|
|
881
898
|
// LoAF tracking state
|
|
882
|
-
__privateAdd$
|
|
899
|
+
__privateAdd$4(this, _loafObserver, null);
|
|
883
900
|
/**
|
|
884
901
|
* Measure frame durations using requestAnimationFrame
|
|
885
902
|
*/
|
|
886
903
|
this.measureFrames = () => {
|
|
887
|
-
if (!__privateGet$
|
|
904
|
+
if (!__privateGet$4(this, _isTracking)) {
|
|
888
905
|
return;
|
|
889
906
|
}
|
|
890
907
|
const currentFrameTime = performance.now();
|
|
891
|
-
const frameLength = currentFrameTime - __privateGet$
|
|
908
|
+
const frameLength = currentFrameTime - __privateGet$4(this, _lastFrameTime);
|
|
892
909
|
if (frameLength > LONG_FRAME_THRESHOLD) {
|
|
893
910
|
const event = {
|
|
894
911
|
duration: frameLength,
|
|
895
912
|
timestamp: currentFrameTime,
|
|
896
913
|
method: "manual"
|
|
897
914
|
};
|
|
898
|
-
if (__privateGet$
|
|
899
|
-
__privateGet$
|
|
915
|
+
if (__privateGet$4(this, _callback)) {
|
|
916
|
+
__privateGet$4(this, _callback).call(this, event);
|
|
900
917
|
}
|
|
901
918
|
if (typeof performance !== "undefined" && performance.mark && performance.measure) {
|
|
902
919
|
const frameId = `long-frame-manual-${currentFrameTime.toFixed(0)}`;
|
|
@@ -916,9 +933,9 @@ class LongFrameDetector {
|
|
|
916
933
|
`Long frame detected (manual): ${frameLength}ms (threshold: ${LONG_FRAME_THRESHOLD}ms)`
|
|
917
934
|
);
|
|
918
935
|
}
|
|
919
|
-
__privateSet$
|
|
920
|
-
if (__privateGet$
|
|
921
|
-
__privateSet$
|
|
936
|
+
__privateSet$4(this, _lastFrameTime, currentFrameTime);
|
|
937
|
+
if (__privateGet$4(this, _isTracking)) {
|
|
938
|
+
__privateSet$4(this, _frameTrackingId, requestAnimationFrame(this.measureFrames));
|
|
922
939
|
}
|
|
923
940
|
};
|
|
924
941
|
}
|
|
@@ -932,12 +949,12 @@ class LongFrameDetector {
|
|
|
932
949
|
* Start detecting long frames and call the provided callback when they occur
|
|
933
950
|
*/
|
|
934
951
|
start(callback) {
|
|
935
|
-
if (__privateGet$
|
|
952
|
+
if (__privateGet$4(this, _isTracking)) {
|
|
936
953
|
writeSceneLog("LongFrameDetector", "Already tracking frames, stopping previous session");
|
|
937
954
|
this.stop();
|
|
938
955
|
}
|
|
939
|
-
__privateSet$
|
|
940
|
-
__privateSet$
|
|
956
|
+
__privateSet$4(this, _callback, callback);
|
|
957
|
+
__privateSet$4(this, _isTracking, true);
|
|
941
958
|
if (this.isLoAFAvailable()) {
|
|
942
959
|
this.startLoAFTracking();
|
|
943
960
|
} else {
|
|
@@ -952,11 +969,11 @@ class LongFrameDetector {
|
|
|
952
969
|
* Stop detecting long frames
|
|
953
970
|
*/
|
|
954
971
|
stop() {
|
|
955
|
-
if (!__privateGet$
|
|
972
|
+
if (!__privateGet$4(this, _isTracking)) {
|
|
956
973
|
return;
|
|
957
974
|
}
|
|
958
|
-
__privateSet$
|
|
959
|
-
__privateSet$
|
|
975
|
+
__privateSet$4(this, _isTracking, false);
|
|
976
|
+
__privateSet$4(this, _callback, null);
|
|
960
977
|
this.stopLoAFTracking();
|
|
961
978
|
this.stopManualFrameTracking();
|
|
962
979
|
}
|
|
@@ -964,7 +981,7 @@ class LongFrameDetector {
|
|
|
964
981
|
* Check if currently tracking frames
|
|
965
982
|
*/
|
|
966
983
|
isTracking() {
|
|
967
|
-
return __privateGet$
|
|
984
|
+
return __privateGet$4(this, _isTracking);
|
|
968
985
|
}
|
|
969
986
|
/**
|
|
970
987
|
* Start tracking using the Long Animation Frame API
|
|
@@ -977,15 +994,15 @@ class LongFrameDetector {
|
|
|
977
994
|
return;
|
|
978
995
|
}
|
|
979
996
|
try {
|
|
980
|
-
__privateSet$
|
|
997
|
+
__privateSet$4(this, _loafObserver, new PerformanceObserver((list) => {
|
|
981
998
|
for (const entry of list.getEntries()) {
|
|
982
999
|
const event = {
|
|
983
1000
|
duration: entry.duration,
|
|
984
1001
|
timestamp: entry.startTime,
|
|
985
1002
|
method: "loaf"
|
|
986
1003
|
};
|
|
987
|
-
if (__privateGet$
|
|
988
|
-
__privateGet$
|
|
1004
|
+
if (__privateGet$4(this, _callback)) {
|
|
1005
|
+
__privateGet$4(this, _callback).call(this, event);
|
|
989
1006
|
}
|
|
990
1007
|
if (typeof performance !== "undefined" && performance.mark && performance.measure) {
|
|
991
1008
|
const frameId = `long-frame-${entry.startTime.toFixed(0)}`;
|
|
@@ -1003,7 +1020,7 @@ class LongFrameDetector {
|
|
|
1003
1020
|
writeSceneLog("LongFrameDetector", `Long frame detected (LoAF): ${entry.duration}ms at ${entry.startTime}ms`);
|
|
1004
1021
|
}
|
|
1005
1022
|
}));
|
|
1006
|
-
__privateGet$
|
|
1023
|
+
__privateGet$4(this, _loafObserver).observe({ type: "long-animation-frame", buffered: false });
|
|
1007
1024
|
} catch (error) {
|
|
1008
1025
|
writeSceneLog("LongFrameDetector", "Failed to start LoAF tracking, falling back to manual:", error);
|
|
1009
1026
|
this.startManualFrameTracking();
|
|
@@ -1013,9 +1030,9 @@ class LongFrameDetector {
|
|
|
1013
1030
|
* Stop LoAF tracking
|
|
1014
1031
|
*/
|
|
1015
1032
|
stopLoAFTracking() {
|
|
1016
|
-
if (__privateGet$
|
|
1017
|
-
__privateGet$
|
|
1018
|
-
__privateSet$
|
|
1033
|
+
if (__privateGet$4(this, _loafObserver)) {
|
|
1034
|
+
__privateGet$4(this, _loafObserver).disconnect();
|
|
1035
|
+
__privateSet$4(this, _loafObserver, null);
|
|
1019
1036
|
writeSceneLog("LongFrameDetector", "Stopped LoAF tracking");
|
|
1020
1037
|
}
|
|
1021
1038
|
}
|
|
@@ -1023,16 +1040,16 @@ class LongFrameDetector {
|
|
|
1023
1040
|
* Start manual frame tracking using requestAnimationFrame
|
|
1024
1041
|
*/
|
|
1025
1042
|
startManualFrameTracking() {
|
|
1026
|
-
__privateSet$
|
|
1027
|
-
__privateSet$
|
|
1043
|
+
__privateSet$4(this, _lastFrameTime, performance.now());
|
|
1044
|
+
__privateSet$4(this, _frameTrackingId, requestAnimationFrame(() => this.measureFrames()));
|
|
1028
1045
|
}
|
|
1029
1046
|
/**
|
|
1030
1047
|
* Stop manual frame tracking
|
|
1031
1048
|
*/
|
|
1032
1049
|
stopManualFrameTracking() {
|
|
1033
|
-
if (__privateGet$
|
|
1034
|
-
cancelAnimationFrame(__privateGet$
|
|
1035
|
-
__privateSet$
|
|
1050
|
+
if (__privateGet$4(this, _frameTrackingId)) {
|
|
1051
|
+
cancelAnimationFrame(__privateGet$4(this, _frameTrackingId));
|
|
1052
|
+
__privateSet$4(this, _frameTrackingId, null);
|
|
1036
1053
|
writeSceneLog("LongFrameDetector", "Stopped manual frame tracking");
|
|
1037
1054
|
}
|
|
1038
1055
|
}
|
|
@@ -1043,38 +1060,38 @@ _frameTrackingId = new WeakMap();
|
|
|
1043
1060
|
_lastFrameTime = new WeakMap();
|
|
1044
1061
|
_loafObserver = new WeakMap();
|
|
1045
1062
|
|
|
1046
|
-
var __typeError$
|
|
1063
|
+
var __typeError$3 = (msg) => {
|
|
1047
1064
|
throw TypeError(msg);
|
|
1048
1065
|
};
|
|
1049
|
-
var __accessCheck$
|
|
1050
|
-
var __privateGet$
|
|
1051
|
-
var __privateAdd$
|
|
1052
|
-
var __privateSet$
|
|
1066
|
+
var __accessCheck$3 = (obj, member, msg) => member.has(obj) || __typeError$3("Cannot " + msg);
|
|
1067
|
+
var __privateGet$3 = (obj, member, getter) => (__accessCheck$3(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
1068
|
+
var __privateAdd$3 = (obj, member, value) => member.has(obj) ? __typeError$3("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
1069
|
+
var __privateSet$3 = (obj, member, value, setter) => (__accessCheck$3(obj, member, "write to private field"), member.set(obj, value), value);
|
|
1053
1070
|
var __privateWrapper = (obj, member, setter, getter) => ({
|
|
1054
1071
|
set _(value) {
|
|
1055
|
-
__privateSet$
|
|
1072
|
+
__privateSet$3(obj, member, value);
|
|
1056
1073
|
},
|
|
1057
1074
|
get _() {
|
|
1058
|
-
return __privateGet$
|
|
1075
|
+
return __privateGet$3(obj, member, getter);
|
|
1059
1076
|
}
|
|
1060
1077
|
});
|
|
1061
|
-
var _profileInProgress, _profileStartTs, _trailAnimationFrameId, _recordedTrailingSpans, _longFrameDetector, _longFramesCount, _longFramesTotalTime, _visibilityChangeHandler;
|
|
1078
|
+
var _profileInProgress$1, _profileStartTs, _trailAnimationFrameId, _recordedTrailingSpans, _longFrameDetector, _longFramesCount, _longFramesTotalTime, _visibilityChangeHandler;
|
|
1062
1079
|
const POST_STORM_WINDOW = 2e3;
|
|
1063
1080
|
const DEFAULT_LONG_FRAME_THRESHOLD = 30;
|
|
1064
1081
|
const TAB_INACTIVE_THRESHOLD = 1e3;
|
|
1065
1082
|
class SceneRenderProfiler {
|
|
1066
1083
|
constructor(queryController) {
|
|
1067
1084
|
this.queryController = queryController;
|
|
1068
|
-
__privateAdd$
|
|
1069
|
-
__privateAdd$
|
|
1070
|
-
__privateAdd$
|
|
1085
|
+
__privateAdd$3(this, _profileInProgress$1, null);
|
|
1086
|
+
__privateAdd$3(this, _profileStartTs, null);
|
|
1087
|
+
__privateAdd$3(this, _trailAnimationFrameId, null);
|
|
1071
1088
|
// Will keep measured lengths trailing frames
|
|
1072
|
-
__privateAdd$
|
|
1089
|
+
__privateAdd$3(this, _recordedTrailingSpans, []);
|
|
1073
1090
|
// Long frame tracking
|
|
1074
|
-
__privateAdd$
|
|
1075
|
-
__privateAdd$
|
|
1076
|
-
__privateAdd$
|
|
1077
|
-
__privateAdd$
|
|
1091
|
+
__privateAdd$3(this, _longFrameDetector);
|
|
1092
|
+
__privateAdd$3(this, _longFramesCount, 0);
|
|
1093
|
+
__privateAdd$3(this, _longFramesTotalTime, 0);
|
|
1094
|
+
__privateAdd$3(this, _visibilityChangeHandler, null);
|
|
1078
1095
|
this.measureTrailingFrames = (measurementStartTs, lastFrameTime, profileStartTs) => {
|
|
1079
1096
|
var _a, _b, _c, _d;
|
|
1080
1097
|
const currentFrameTime = performance.now();
|
|
@@ -1084,26 +1101,26 @@ class SceneRenderProfiler {
|
|
|
1084
1101
|
this.cancelProfile();
|
|
1085
1102
|
return;
|
|
1086
1103
|
}
|
|
1087
|
-
__privateGet$
|
|
1104
|
+
__privateGet$3(this, _recordedTrailingSpans).push(frameLength);
|
|
1088
1105
|
if (currentFrameTime - measurementStartTs < POST_STORM_WINDOW) {
|
|
1089
|
-
if (__privateGet$
|
|
1090
|
-
__privateSet$
|
|
1106
|
+
if (__privateGet$3(this, _profileInProgress$1)) {
|
|
1107
|
+
__privateSet$3(this, _trailAnimationFrameId, requestAnimationFrame(
|
|
1091
1108
|
() => this.measureTrailingFrames(measurementStartTs, currentFrameTime, profileStartTs)
|
|
1092
1109
|
));
|
|
1093
1110
|
}
|
|
1094
1111
|
} else {
|
|
1095
|
-
const slowFrames = processRecordedSpans(__privateGet$
|
|
1112
|
+
const slowFrames = processRecordedSpans(__privateGet$3(this, _recordedTrailingSpans));
|
|
1096
1113
|
const slowFramesTime = slowFrames.reduce((acc, val) => acc + val, 0);
|
|
1097
1114
|
writeSceneLog(
|
|
1098
1115
|
"SceneRenderProfiler",
|
|
1099
1116
|
`Profile tail recorded - Slow frames: ${slowFramesTime.toFixed(1)}ms (${slowFrames.length} frames)`
|
|
1100
1117
|
);
|
|
1101
|
-
writeSceneLog("", ` \u251C\u2500 Origin: ${((_a = __privateGet$
|
|
1102
|
-
writeSceneLog("", ` \u2514\u2500 Crumbs:`, ((_b = __privateGet$
|
|
1103
|
-
__privateSet$
|
|
1118
|
+
writeSceneLog("", ` \u251C\u2500 Origin: ${((_a = __privateGet$3(this, _profileInProgress$1)) == null ? void 0 : _a.origin) || "unknown"}`);
|
|
1119
|
+
writeSceneLog("", ` \u2514\u2500 Crumbs:`, ((_b = __privateGet$3(this, _profileInProgress$1)) == null ? void 0 : _b.crumbs) || []);
|
|
1120
|
+
__privateSet$3(this, _recordedTrailingSpans, []);
|
|
1104
1121
|
const profileDuration = measurementStartTs - profileStartTs;
|
|
1105
1122
|
if (typeof performance !== "undefined" && performance.mark) {
|
|
1106
|
-
const profileName = ((_c = __privateGet$
|
|
1123
|
+
const profileName = ((_c = __privateGet$3(this, _profileInProgress$1)) == null ? void 0 : _c.origin) || "unknown";
|
|
1107
1124
|
const totalTime = profileDuration + slowFramesTime;
|
|
1108
1125
|
performance.mark(`Dashboard Profile End: ${profileName}`);
|
|
1109
1126
|
const startMarkName = `Dashboard Profile Start: ${profileName}`;
|
|
@@ -1124,7 +1141,7 @@ class SceneRenderProfiler {
|
|
|
1124
1141
|
slowFrames.forEach((frameTime, index) => {
|
|
1125
1142
|
if (frameTime > 16) {
|
|
1126
1143
|
try {
|
|
1127
|
-
const frameStartTime = __privateGet$
|
|
1144
|
+
const frameStartTime = __privateGet$3(this, _profileStartTs) + profileDuration + (index > 0 ? slowFrames.slice(0, index).reduce((sum, t) => sum + t, 0) : 0);
|
|
1128
1145
|
const frameId = `slow-frame-${index}`;
|
|
1129
1146
|
const frameStartMark = `${frameId}-start`;
|
|
1130
1147
|
const frameEndMark = `${frameId}-end`;
|
|
@@ -1143,33 +1160,33 @@ class SceneRenderProfiler {
|
|
|
1143
1160
|
writeSceneLog("", ` \u251C\u2500 Timestamp: ${completionTimestamp.toFixed(1)}ms`);
|
|
1144
1161
|
writeSceneLog("", ` \u251C\u2500 Total time: ${(profileDuration + slowFramesTime).toFixed(1)}ms`);
|
|
1145
1162
|
writeSceneLog("", ` \u251C\u2500 Slow frames: ${slowFramesTime}ms (${slowFrames.length} frames)`);
|
|
1146
|
-
writeSceneLog("", ` \u2514\u2500 Long frames: ${__privateGet$
|
|
1147
|
-
__privateGet$
|
|
1163
|
+
writeSceneLog("", ` \u2514\u2500 Long frames: ${__privateGet$3(this, _longFramesTotalTime)}ms (${__privateGet$3(this, _longFramesCount)} frames)`);
|
|
1164
|
+
__privateGet$3(this, _longFrameDetector).stop();
|
|
1148
1165
|
writeSceneLogStyled(
|
|
1149
1166
|
"SceneRenderProfiler",
|
|
1150
1167
|
`Stopped long frame detection - profile complete at ${completionTimestamp.toFixed(1)}ms`,
|
|
1151
1168
|
"color: #00CC00; font-weight: bold;"
|
|
1152
1169
|
);
|
|
1153
|
-
__privateSet$
|
|
1170
|
+
__privateSet$3(this, _trailAnimationFrameId, null);
|
|
1154
1171
|
const profileEndTs = profileStartTs + profileDuration + slowFramesTime;
|
|
1155
|
-
if (!__privateGet$
|
|
1172
|
+
if (!__privateGet$3(this, _profileInProgress$1)) {
|
|
1156
1173
|
return;
|
|
1157
1174
|
}
|
|
1158
|
-
performance.measure(`DashboardInteraction ${__privateGet$
|
|
1175
|
+
performance.measure(`DashboardInteraction ${__privateGet$3(this, _profileInProgress$1).origin}`, {
|
|
1159
1176
|
start: profileStartTs,
|
|
1160
1177
|
end: profileEndTs
|
|
1161
1178
|
});
|
|
1162
1179
|
const networkDuration = captureNetwork(profileStartTs, profileEndTs);
|
|
1163
|
-
if (((_d = this.queryController) == null ? void 0 : _d.state.onProfileComplete) && __privateGet$
|
|
1180
|
+
if (((_d = this.queryController) == null ? void 0 : _d.state.onProfileComplete) && __privateGet$3(this, _profileInProgress$1)) {
|
|
1164
1181
|
this.queryController.state.onProfileComplete({
|
|
1165
|
-
origin: __privateGet$
|
|
1166
|
-
crumbs: __privateGet$
|
|
1182
|
+
origin: __privateGet$3(this, _profileInProgress$1).origin,
|
|
1183
|
+
crumbs: __privateGet$3(this, _profileInProgress$1).crumbs,
|
|
1167
1184
|
duration: profileDuration + slowFramesTime,
|
|
1168
1185
|
networkDuration,
|
|
1169
1186
|
startTs: profileStartTs,
|
|
1170
1187
|
endTs: profileEndTs,
|
|
1171
|
-
longFramesCount: __privateGet$
|
|
1172
|
-
longFramesTotalTime: __privateGet$
|
|
1188
|
+
longFramesCount: __privateGet$3(this, _longFramesCount),
|
|
1189
|
+
longFramesTotalTime: __privateGet$3(this, _longFramesTotalTime),
|
|
1173
1190
|
// @ts-ignore
|
|
1174
1191
|
jsHeapSizeLimit: performance.memory ? performance.memory.jsHeapSizeLimit : 0,
|
|
1175
1192
|
// @ts-ignore
|
|
@@ -1177,8 +1194,8 @@ class SceneRenderProfiler {
|
|
|
1177
1194
|
// @ts-ignore
|
|
1178
1195
|
totalJSHeapSize: performance.memory ? performance.memory.totalJSHeapSize : 0
|
|
1179
1196
|
});
|
|
1180
|
-
__privateSet$
|
|
1181
|
-
__privateSet$
|
|
1197
|
+
__privateSet$3(this, _profileInProgress$1, null);
|
|
1198
|
+
__privateSet$3(this, _trailAnimationFrameId, null);
|
|
1182
1199
|
}
|
|
1183
1200
|
if (window.__runs) {
|
|
1184
1201
|
window.__runs += `${Date.now()}, ${profileDuration + slowFramesTime}
|
|
@@ -1189,32 +1206,32 @@ class SceneRenderProfiler {
|
|
|
1189
1206
|
}
|
|
1190
1207
|
}
|
|
1191
1208
|
};
|
|
1192
|
-
__privateSet$
|
|
1209
|
+
__privateSet$3(this, _longFrameDetector, new LongFrameDetector());
|
|
1193
1210
|
this.setupVisibilityChangeHandler();
|
|
1194
1211
|
}
|
|
1195
1212
|
setQueryController(queryController) {
|
|
1196
1213
|
this.queryController = queryController;
|
|
1197
1214
|
}
|
|
1198
1215
|
setupVisibilityChangeHandler() {
|
|
1199
|
-
if (__privateGet$
|
|
1216
|
+
if (__privateGet$3(this, _visibilityChangeHandler)) {
|
|
1200
1217
|
return;
|
|
1201
1218
|
}
|
|
1202
|
-
__privateSet$
|
|
1203
|
-
if (document.hidden && __privateGet$
|
|
1219
|
+
__privateSet$3(this, _visibilityChangeHandler, () => {
|
|
1220
|
+
if (document.hidden && __privateGet$3(this, _profileInProgress$1)) {
|
|
1204
1221
|
writeSceneLog("SceneRenderProfiler", "Tab became inactive, cancelling profile");
|
|
1205
1222
|
this.cancelProfile();
|
|
1206
1223
|
}
|
|
1207
1224
|
});
|
|
1208
1225
|
if (typeof document !== "undefined") {
|
|
1209
|
-
document.addEventListener("visibilitychange", __privateGet$
|
|
1226
|
+
document.addEventListener("visibilitychange", __privateGet$3(this, _visibilityChangeHandler));
|
|
1210
1227
|
}
|
|
1211
1228
|
}
|
|
1212
1229
|
cleanup() {
|
|
1213
|
-
if (__privateGet$
|
|
1214
|
-
document.removeEventListener("visibilitychange", __privateGet$
|
|
1215
|
-
__privateSet$
|
|
1230
|
+
if (__privateGet$3(this, _visibilityChangeHandler) && typeof document !== "undefined") {
|
|
1231
|
+
document.removeEventListener("visibilitychange", __privateGet$3(this, _visibilityChangeHandler));
|
|
1232
|
+
__privateSet$3(this, _visibilityChangeHandler, null);
|
|
1216
1233
|
}
|
|
1217
|
-
__privateGet$
|
|
1234
|
+
__privateGet$3(this, _longFrameDetector).stop();
|
|
1218
1235
|
this.cancelProfile();
|
|
1219
1236
|
}
|
|
1220
1237
|
startProfile(name) {
|
|
@@ -1222,8 +1239,8 @@ class SceneRenderProfiler {
|
|
|
1222
1239
|
writeSceneLog("SceneRenderProfiler", "Tab is inactive, skipping profile", name);
|
|
1223
1240
|
return;
|
|
1224
1241
|
}
|
|
1225
|
-
if (__privateGet$
|
|
1226
|
-
if (__privateGet$
|
|
1242
|
+
if (__privateGet$3(this, _profileInProgress$1)) {
|
|
1243
|
+
if (__privateGet$3(this, _trailAnimationFrameId)) {
|
|
1227
1244
|
this.cancelProfile();
|
|
1228
1245
|
this._startNewProfile(name, true);
|
|
1229
1246
|
} else {
|
|
@@ -1245,10 +1262,10 @@ class SceneRenderProfiler {
|
|
|
1245
1262
|
*/
|
|
1246
1263
|
_startNewProfile(name, force = false) {
|
|
1247
1264
|
var _a;
|
|
1248
|
-
__privateSet$
|
|
1249
|
-
__privateSet$
|
|
1250
|
-
__privateSet$
|
|
1251
|
-
__privateSet$
|
|
1265
|
+
__privateSet$3(this, _profileInProgress$1, { origin: name, crumbs: [] });
|
|
1266
|
+
__privateSet$3(this, _profileStartTs, performance.now());
|
|
1267
|
+
__privateSet$3(this, _longFramesCount, 0);
|
|
1268
|
+
__privateSet$3(this, _longFramesTotalTime, 0);
|
|
1252
1269
|
if (typeof performance !== "undefined" && performance.mark) {
|
|
1253
1270
|
const markName = `Dashboard Profile Start: ${name}`;
|
|
1254
1271
|
performance.mark(markName);
|
|
@@ -1258,66 +1275,66 @@ class SceneRenderProfiler {
|
|
|
1258
1275
|
`Profile started[${force ? "forced" : "clean"}]`,
|
|
1259
1276
|
"color: #FFCC00; font-weight: bold;"
|
|
1260
1277
|
);
|
|
1261
|
-
writeSceneLog("", ` \u251C\u2500 Origin: ${((_a = __privateGet$
|
|
1262
|
-
writeSceneLog("", ` \u2514\u2500 Timestamp: ${__privateGet$
|
|
1263
|
-
__privateGet$
|
|
1264
|
-
if (!__privateGet$
|
|
1278
|
+
writeSceneLog("", ` \u251C\u2500 Origin: ${((_a = __privateGet$3(this, _profileInProgress$1)) == null ? void 0 : _a.origin) || "unknown"}`);
|
|
1279
|
+
writeSceneLog("", ` \u2514\u2500 Timestamp: ${__privateGet$3(this, _profileStartTs).toFixed(1)}ms`);
|
|
1280
|
+
__privateGet$3(this, _longFrameDetector).start((event) => {
|
|
1281
|
+
if (!__privateGet$3(this, _profileInProgress$1) || !__privateGet$3(this, _profileStartTs)) {
|
|
1265
1282
|
return;
|
|
1266
1283
|
}
|
|
1267
|
-
if (event.timestamp < __privateGet$
|
|
1284
|
+
if (event.timestamp < __privateGet$3(this, _profileStartTs)) {
|
|
1268
1285
|
return;
|
|
1269
1286
|
}
|
|
1270
1287
|
__privateWrapper(this, _longFramesCount)._++;
|
|
1271
|
-
__privateSet$
|
|
1288
|
+
__privateSet$3(this, _longFramesTotalTime, __privateGet$3(this, _longFramesTotalTime) + event.duration);
|
|
1272
1289
|
});
|
|
1273
1290
|
}
|
|
1274
1291
|
recordProfileTail(measurementStartTime, profileStartTs) {
|
|
1275
|
-
__privateSet$
|
|
1292
|
+
__privateSet$3(this, _trailAnimationFrameId, requestAnimationFrame(
|
|
1276
1293
|
() => this.measureTrailingFrames(measurementStartTime, measurementStartTime, profileStartTs)
|
|
1277
1294
|
));
|
|
1278
1295
|
}
|
|
1279
1296
|
tryCompletingProfile() {
|
|
1280
1297
|
var _a;
|
|
1281
|
-
writeSceneLog("SceneRenderProfiler", "Trying to complete profile", __privateGet$
|
|
1282
|
-
if (((_a = this.queryController) == null ? void 0 : _a.runningQueriesCount()) === 0 && __privateGet$
|
|
1298
|
+
writeSceneLog("SceneRenderProfiler", "Trying to complete profile", __privateGet$3(this, _profileInProgress$1));
|
|
1299
|
+
if (((_a = this.queryController) == null ? void 0 : _a.runningQueriesCount()) === 0 && __privateGet$3(this, _profileInProgress$1)) {
|
|
1283
1300
|
writeSceneLog("SceneRenderProfiler", "All queries completed, starting tail measurement");
|
|
1284
|
-
this.recordProfileTail(performance.now(), __privateGet$
|
|
1301
|
+
this.recordProfileTail(performance.now(), __privateGet$3(this, _profileStartTs));
|
|
1285
1302
|
}
|
|
1286
1303
|
}
|
|
1287
1304
|
isTailRecording() {
|
|
1288
|
-
return Boolean(__privateGet$
|
|
1305
|
+
return Boolean(__privateGet$3(this, _trailAnimationFrameId));
|
|
1289
1306
|
}
|
|
1290
1307
|
cancelTailRecording() {
|
|
1291
|
-
if (__privateGet$
|
|
1292
|
-
cancelAnimationFrame(__privateGet$
|
|
1293
|
-
__privateSet$
|
|
1308
|
+
if (__privateGet$3(this, _trailAnimationFrameId)) {
|
|
1309
|
+
cancelAnimationFrame(__privateGet$3(this, _trailAnimationFrameId));
|
|
1310
|
+
__privateSet$3(this, _trailAnimationFrameId, null);
|
|
1294
1311
|
writeSceneLog("SceneRenderProfiler", "Cancelled recording frames, new profile started");
|
|
1295
1312
|
}
|
|
1296
1313
|
}
|
|
1297
1314
|
// cancel profile
|
|
1298
1315
|
cancelProfile() {
|
|
1299
|
-
if (__privateGet$
|
|
1300
|
-
writeSceneLog("SceneRenderProfiler", "Cancelling profile", __privateGet$
|
|
1301
|
-
__privateSet$
|
|
1302
|
-
if (__privateGet$
|
|
1303
|
-
cancelAnimationFrame(__privateGet$
|
|
1304
|
-
__privateSet$
|
|
1305
|
-
}
|
|
1306
|
-
__privateGet$
|
|
1316
|
+
if (__privateGet$3(this, _profileInProgress$1)) {
|
|
1317
|
+
writeSceneLog("SceneRenderProfiler", "Cancelling profile", __privateGet$3(this, _profileInProgress$1));
|
|
1318
|
+
__privateSet$3(this, _profileInProgress$1, null);
|
|
1319
|
+
if (__privateGet$3(this, _trailAnimationFrameId)) {
|
|
1320
|
+
cancelAnimationFrame(__privateGet$3(this, _trailAnimationFrameId));
|
|
1321
|
+
__privateSet$3(this, _trailAnimationFrameId, null);
|
|
1322
|
+
}
|
|
1323
|
+
__privateGet$3(this, _longFrameDetector).stop();
|
|
1307
1324
|
writeSceneLog("SceneRenderProfiler", "Stopped long frame detection - profile cancelled");
|
|
1308
|
-
__privateSet$
|
|
1309
|
-
__privateSet$
|
|
1310
|
-
__privateSet$
|
|
1325
|
+
__privateSet$3(this, _recordedTrailingSpans, []);
|
|
1326
|
+
__privateSet$3(this, _longFramesCount, 0);
|
|
1327
|
+
__privateSet$3(this, _longFramesTotalTime, 0);
|
|
1311
1328
|
}
|
|
1312
1329
|
}
|
|
1313
1330
|
addCrumb(crumb) {
|
|
1314
|
-
if (__privateGet$
|
|
1331
|
+
if (__privateGet$3(this, _profileInProgress$1)) {
|
|
1315
1332
|
writeSceneLog("SceneRenderProfiler", "Adding crumb:", crumb);
|
|
1316
|
-
__privateGet$
|
|
1333
|
+
__privateGet$3(this, _profileInProgress$1).crumbs.push(crumb);
|
|
1317
1334
|
}
|
|
1318
1335
|
}
|
|
1319
1336
|
}
|
|
1320
|
-
_profileInProgress = new WeakMap();
|
|
1337
|
+
_profileInProgress$1 = new WeakMap();
|
|
1321
1338
|
_profileStartTs = new WeakMap();
|
|
1322
1339
|
_trailAnimationFrameId = new WeakMap();
|
|
1323
1340
|
_recordedTrailingSpans = new WeakMap();
|
|
@@ -3486,22 +3503,22 @@ function getEnrichedFiltersRequest(sourceRunner) {
|
|
|
3486
3503
|
return null;
|
|
3487
3504
|
}
|
|
3488
3505
|
|
|
3489
|
-
var __typeError$
|
|
3506
|
+
var __typeError$2 = (msg) => {
|
|
3490
3507
|
throw TypeError(msg);
|
|
3491
3508
|
};
|
|
3492
|
-
var __accessCheck$
|
|
3493
|
-
var __privateGet$
|
|
3494
|
-
var __privateAdd$
|
|
3495
|
-
var __privateSet$
|
|
3509
|
+
var __accessCheck$2 = (obj, member, msg) => member.has(obj) || __typeError$2("Cannot " + msg);
|
|
3510
|
+
var __privateGet$2 = (obj, member, getter) => (__accessCheck$2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
3511
|
+
var __privateAdd$2 = (obj, member, value) => member.has(obj) ? __typeError$2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
3512
|
+
var __privateSet$2 = (obj, member, value, setter) => (__accessCheck$2(obj, member, "write to private field"), member.set(obj, value), value);
|
|
3496
3513
|
var _value;
|
|
3497
3514
|
class SafeSerializableSceneObject {
|
|
3498
3515
|
constructor(value) {
|
|
3499
|
-
__privateAdd$
|
|
3516
|
+
__privateAdd$2(this, _value);
|
|
3500
3517
|
this.text = "__sceneObject";
|
|
3501
3518
|
this.valueOf = () => {
|
|
3502
|
-
return __privateGet$
|
|
3519
|
+
return __privateGet$2(this, _value);
|
|
3503
3520
|
};
|
|
3504
|
-
__privateSet$
|
|
3521
|
+
__privateSet$2(this, _value, value);
|
|
3505
3522
|
}
|
|
3506
3523
|
toString() {
|
|
3507
3524
|
return void 0;
|
|
@@ -3655,6 +3672,87 @@ const GroupByValueContainer = ({
|
|
|
3655
3672
|
return /* @__PURE__ */ React__default.default.createElement("div", { className: css.cx(styles.multiValueContainer, !isApplicable && css.cx(disabledPill, strikethrough)) }, children);
|
|
3656
3673
|
};
|
|
3657
3674
|
|
|
3675
|
+
var __typeError$1 = (msg) => {
|
|
3676
|
+
throw TypeError(msg);
|
|
3677
|
+
};
|
|
3678
|
+
var __accessCheck$1 = (obj, member, msg) => member.has(obj) || __typeError$1("Cannot " + msg);
|
|
3679
|
+
var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "read from private field"), member.get(obj));
|
|
3680
|
+
var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
3681
|
+
var __privateSet$1 = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
|
|
3682
|
+
var _profileInProgress;
|
|
3683
|
+
class SceneInteractionProfiler {
|
|
3684
|
+
constructor() {
|
|
3685
|
+
this.queryController = null;
|
|
3686
|
+
this.isInteractionProfiler = true;
|
|
3687
|
+
__privateAdd$1(this, _profileInProgress, null);
|
|
3688
|
+
__privateSet$1(this, _profileInProgress, null);
|
|
3689
|
+
}
|
|
3690
|
+
setQueryController(queryController) {
|
|
3691
|
+
this.queryController = queryController;
|
|
3692
|
+
}
|
|
3693
|
+
startProfile(interaction) {
|
|
3694
|
+
if (__privateGet$1(this, _profileInProgress)) {
|
|
3695
|
+
this.cancelProfile();
|
|
3696
|
+
}
|
|
3697
|
+
__privateSet$1(this, _profileInProgress, {
|
|
3698
|
+
interaction,
|
|
3699
|
+
startTs: performance.now()
|
|
3700
|
+
});
|
|
3701
|
+
writeSceneLog("SceneInteractionProfiler", "Started profiling interaction:", interaction);
|
|
3702
|
+
}
|
|
3703
|
+
stopProfile() {
|
|
3704
|
+
var _a, _b;
|
|
3705
|
+
if (!__privateGet$1(this, _profileInProgress)) {
|
|
3706
|
+
return;
|
|
3707
|
+
}
|
|
3708
|
+
const endTs = performance.now();
|
|
3709
|
+
const interactionDuration = endTs - __privateGet$1(this, _profileInProgress).startTs;
|
|
3710
|
+
const networkDuration = captureNetwork(__privateGet$1(this, _profileInProgress).startTs, endTs);
|
|
3711
|
+
const result = {
|
|
3712
|
+
origin: __privateGet$1(this, _profileInProgress).interaction,
|
|
3713
|
+
duration: interactionDuration,
|
|
3714
|
+
networkDuration,
|
|
3715
|
+
startTs: __privateGet$1(this, _profileInProgress).startTs,
|
|
3716
|
+
endTs
|
|
3717
|
+
};
|
|
3718
|
+
writeSceneLog("SceneInteractionProfiler", "Completed profile:", result);
|
|
3719
|
+
if (((_a = this.queryController) == null ? void 0 : _a.state.onProfileComplete) && __privateGet$1(this, _profileInProgress)) {
|
|
3720
|
+
(_b = this.queryController) == null ? void 0 : _b.state.onProfileComplete(result);
|
|
3721
|
+
}
|
|
3722
|
+
performance.mark(`${__privateGet$1(this, _profileInProgress).interaction}_start`, {
|
|
3723
|
+
startTime: __privateGet$1(this, _profileInProgress).startTs
|
|
3724
|
+
});
|
|
3725
|
+
performance.mark(`${__privateGet$1(this, _profileInProgress).interaction}_end`, {
|
|
3726
|
+
startTime: endTs
|
|
3727
|
+
});
|
|
3728
|
+
performance.measure(
|
|
3729
|
+
`Interaction_${__privateGet$1(this, _profileInProgress).interaction}`,
|
|
3730
|
+
`${__privateGet$1(this, _profileInProgress).interaction}_start`,
|
|
3731
|
+
`${__privateGet$1(this, _profileInProgress).interaction}_end`
|
|
3732
|
+
);
|
|
3733
|
+
__privateSet$1(this, _profileInProgress, null);
|
|
3734
|
+
}
|
|
3735
|
+
cancelProfile() {
|
|
3736
|
+
if (__privateGet$1(this, _profileInProgress)) {
|
|
3737
|
+
writeSceneLog("SceneInteractionProfiler", "Cancelled profile:", __privateGet$1(this, _profileInProgress).interaction);
|
|
3738
|
+
__privateSet$1(this, _profileInProgress, null);
|
|
3739
|
+
}
|
|
3740
|
+
}
|
|
3741
|
+
isProfileActive() {
|
|
3742
|
+
return __privateGet$1(this, _profileInProgress) !== null;
|
|
3743
|
+
}
|
|
3744
|
+
getCurrentInteraction() {
|
|
3745
|
+
var _a, _b;
|
|
3746
|
+
return (_b = (_a = __privateGet$1(this, _profileInProgress)) == null ? void 0 : _a.interaction) != null ? _b : null;
|
|
3747
|
+
}
|
|
3748
|
+
}
|
|
3749
|
+
_profileInProgress = new WeakMap();
|
|
3750
|
+
const USER_INTERACTIONS = {
|
|
3751
|
+
ADHOC_KEYS_DROPDOWN: "adhoc_keys_dropdown",
|
|
3752
|
+
ADHOC_VALUES_DROPDOWN: "adhoc_values_dropdown",
|
|
3753
|
+
GROUPBY_DROPDOWN: "groupby_dropdown"
|
|
3754
|
+
};
|
|
3755
|
+
|
|
3658
3756
|
class GroupByVariable extends MultiValueVariable {
|
|
3659
3757
|
constructor(initialState) {
|
|
3660
3758
|
super({
|
|
@@ -3960,10 +4058,13 @@ function GroupByVariableRenderer({ model }) {
|
|
|
3960
4058
|
setUncommittedValue(newValue);
|
|
3961
4059
|
},
|
|
3962
4060
|
onOpenMenu: async () => {
|
|
4061
|
+
const profiler = getQueryController(model);
|
|
4062
|
+
profiler == null ? void 0 : profiler.startInteractionProfile(USER_INTERACTIONS.GROUPBY_DROPDOWN);
|
|
3963
4063
|
setIsFetchingOptions(true);
|
|
3964
4064
|
await rxjs.lastValueFrom(model.validateAndUpdate());
|
|
3965
4065
|
setIsFetchingOptions(false);
|
|
3966
4066
|
setIsOptionsOpen(true);
|
|
4067
|
+
profiler == null ? void 0 : profiler.stopInteractionProfile();
|
|
3967
4068
|
},
|
|
3968
4069
|
onCloseMenu: () => {
|
|
3969
4070
|
setIsOptionsOpen(false);
|
|
@@ -4013,10 +4114,13 @@ function GroupByVariableRenderer({ model }) {
|
|
|
4013
4114
|
}
|
|
4014
4115
|
},
|
|
4015
4116
|
onOpenMenu: async () => {
|
|
4117
|
+
const profiler = getQueryController(model);
|
|
4118
|
+
profiler == null ? void 0 : profiler.startInteractionProfile(USER_INTERACTIONS.GROUPBY_DROPDOWN);
|
|
4016
4119
|
setIsFetchingOptions(true);
|
|
4017
4120
|
await rxjs.lastValueFrom(model.validateAndUpdate());
|
|
4018
4121
|
setIsFetchingOptions(false);
|
|
4019
4122
|
setIsOptionsOpen(true);
|
|
4123
|
+
profiler == null ? void 0 : profiler.stopInteractionProfile();
|
|
4020
4124
|
},
|
|
4021
4125
|
onCloseMenu: () => {
|
|
4022
4126
|
setIsOptionsOpen(false);
|
|
@@ -5181,6 +5285,11 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
|
|
|
5181
5285
|
const handleFetchOptions = React.useCallback(
|
|
5182
5286
|
async (inputType) => {
|
|
5183
5287
|
var _a2;
|
|
5288
|
+
const profiler = getQueryController(model);
|
|
5289
|
+
const interactionName = inputType === "key" ? USER_INTERACTIONS.ADHOC_KEYS_DROPDOWN : USER_INTERACTIONS.ADHOC_VALUES_DROPDOWN;
|
|
5290
|
+
if (inputType !== "operator") {
|
|
5291
|
+
profiler == null ? void 0 : profiler.startInteractionProfile(interactionName);
|
|
5292
|
+
}
|
|
5184
5293
|
setOptionsError(false);
|
|
5185
5294
|
setOptionsLoading(true);
|
|
5186
5295
|
setOptions([]);
|
|
@@ -5194,6 +5303,7 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
|
|
|
5194
5303
|
options2 = await model._getValuesFor(filter);
|
|
5195
5304
|
}
|
|
5196
5305
|
if (filterInputTypeRef.current !== inputType) {
|
|
5306
|
+
profiler == null ? void 0 : profiler.stopInteractionProfile();
|
|
5197
5307
|
return;
|
|
5198
5308
|
}
|
|
5199
5309
|
setOptions(options2);
|
|
@@ -5206,6 +5316,7 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
|
|
|
5206
5316
|
setOptionsError(true);
|
|
5207
5317
|
}
|
|
5208
5318
|
setOptionsLoading(false);
|
|
5319
|
+
profiler == null ? void 0 : profiler.stopInteractionProfile();
|
|
5209
5320
|
},
|
|
5210
5321
|
[filter, model]
|
|
5211
5322
|
);
|
|
@@ -6746,6 +6857,9 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
|
6746
6857
|
this._variableValueRecorder = new VariableValueRecorder();
|
|
6747
6858
|
this._results = new rxjs.ReplaySubject(1);
|
|
6748
6859
|
this._scopedVars = { __sceneObject: wrapInSafeSerializableSceneObject(this) };
|
|
6860
|
+
this._isInView = true;
|
|
6861
|
+
this._bypassIsInView = false;
|
|
6862
|
+
this._queryNotExecutedWhenOutOfView = false;
|
|
6749
6863
|
this._variableDependency = new VariableDependencyConfig(this, {
|
|
6750
6864
|
statePaths: ["queries", "datasource", "minInterval"],
|
|
6751
6865
|
onVariableUpdateCompleted: this.onVariableUpdatesCompleted.bind(this),
|
|
@@ -6985,6 +7099,11 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
|
6985
7099
|
if (!this.state.maxDataPoints && this.state.maxDataPointsFromWidth && !this._containerWidth) {
|
|
6986
7100
|
return;
|
|
6987
7101
|
}
|
|
7102
|
+
if (this.isQueryModeAuto() && !this._isInView && !this._bypassIsInView) {
|
|
7103
|
+
this._queryNotExecutedWhenOutOfView = true;
|
|
7104
|
+
return;
|
|
7105
|
+
}
|
|
7106
|
+
this._queryNotExecutedWhenOutOfView = false;
|
|
6988
7107
|
if (!this._dataLayersSub) {
|
|
6989
7108
|
this._handleDataLayers();
|
|
6990
7109
|
}
|
|
@@ -7148,6 +7267,20 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
|
7148
7267
|
var _a;
|
|
7149
7268
|
return ((_a = this.state.runQueriesMode) != null ? _a : "auto") === "auto";
|
|
7150
7269
|
}
|
|
7270
|
+
isInViewChanged(isInView) {
|
|
7271
|
+
writeSceneLog("SceneQueryRunner", `isInViewChanged: ${isInView}`, this.state.key);
|
|
7272
|
+
this._isInView = isInView;
|
|
7273
|
+
if (isInView && this._queryNotExecutedWhenOutOfView) {
|
|
7274
|
+
this.runQueries();
|
|
7275
|
+
}
|
|
7276
|
+
}
|
|
7277
|
+
bypassIsInViewChanged(bypassIsInView) {
|
|
7278
|
+
writeSceneLog("SceneQueryRunner", `bypassIsInViewChanged: ${bypassIsInView}`, this.state.key);
|
|
7279
|
+
this._bypassIsInView = bypassIsInView;
|
|
7280
|
+
if (bypassIsInView && this._queryNotExecutedWhenOutOfView) {
|
|
7281
|
+
this.runQueries();
|
|
7282
|
+
}
|
|
7283
|
+
}
|
|
7151
7284
|
}
|
|
7152
7285
|
function findFirstDatasource(targets) {
|
|
7153
7286
|
var _a, _b;
|
|
@@ -8588,6 +8721,71 @@ const getStyles$8 = (theme) => ({
|
|
|
8588
8721
|
})
|
|
8589
8722
|
});
|
|
8590
8723
|
|
|
8724
|
+
function useUniqueId() {
|
|
8725
|
+
var _a;
|
|
8726
|
+
const idRefLazy = React.useRef(void 0);
|
|
8727
|
+
(_a = idRefLazy.current) != null ? _a : idRefLazy.current = lodash.uniqueId();
|
|
8728
|
+
return idRefLazy.current;
|
|
8729
|
+
}
|
|
8730
|
+
const LazyLoader = React__default.default.forwardRef(
|
|
8731
|
+
({ children, onLoad, onChange, className, ...rest }, ref) => {
|
|
8732
|
+
const id = useUniqueId();
|
|
8733
|
+
const { hideEmpty } = ui.useStyles2(getStyles$7);
|
|
8734
|
+
const [loaded, setLoaded] = React.useState(false);
|
|
8735
|
+
const [isInView, setIsInView] = React.useState(false);
|
|
8736
|
+
const innerRef = React.useRef(null);
|
|
8737
|
+
React.useImperativeHandle(ref, () => innerRef.current);
|
|
8738
|
+
reactUse.useEffectOnce(() => {
|
|
8739
|
+
LazyLoader.addCallback(id, (entry) => {
|
|
8740
|
+
if (!loaded && entry.isIntersecting) {
|
|
8741
|
+
setLoaded(true);
|
|
8742
|
+
onLoad == null ? void 0 : onLoad();
|
|
8743
|
+
}
|
|
8744
|
+
setIsInView(entry.isIntersecting);
|
|
8745
|
+
onChange == null ? void 0 : onChange(entry.isIntersecting);
|
|
8746
|
+
});
|
|
8747
|
+
const wrapperEl = innerRef.current;
|
|
8748
|
+
if (wrapperEl) {
|
|
8749
|
+
LazyLoader.observer.observe(wrapperEl);
|
|
8750
|
+
}
|
|
8751
|
+
return () => {
|
|
8752
|
+
wrapperEl && LazyLoader.observer.unobserve(wrapperEl);
|
|
8753
|
+
delete LazyLoader.callbacks[id];
|
|
8754
|
+
if (Object.keys(LazyLoader.callbacks).length === 0) {
|
|
8755
|
+
LazyLoader.observer.disconnect();
|
|
8756
|
+
}
|
|
8757
|
+
};
|
|
8758
|
+
});
|
|
8759
|
+
return /* @__PURE__ */ React__default.default.createElement("div", { id, ref: innerRef, className: `${hideEmpty} ${className}`, ...rest }, !loaded ? i18n.t("grafana-scenes.components.lazy-loader.placeholder", "\xA0") : /* @__PURE__ */ React__default.default.createElement(LazyLoaderInViewContext.Provider, { value: isInView }, children));
|
|
8760
|
+
}
|
|
8761
|
+
);
|
|
8762
|
+
function getStyles$7() {
|
|
8763
|
+
return {
|
|
8764
|
+
hideEmpty: css.css({
|
|
8765
|
+
"&:empty": {
|
|
8766
|
+
display: "none"
|
|
8767
|
+
}
|
|
8768
|
+
})
|
|
8769
|
+
};
|
|
8770
|
+
}
|
|
8771
|
+
LazyLoader.displayName = "LazyLoader";
|
|
8772
|
+
LazyLoader.callbacks = {};
|
|
8773
|
+
LazyLoader.addCallback = (id, c) => LazyLoader.callbacks[id] = c;
|
|
8774
|
+
LazyLoader.observer = new IntersectionObserver(
|
|
8775
|
+
(entries) => {
|
|
8776
|
+
for (const entry of entries) {
|
|
8777
|
+
if (typeof LazyLoader.callbacks[entry.target.id] === "function") {
|
|
8778
|
+
LazyLoader.callbacks[entry.target.id](entry);
|
|
8779
|
+
}
|
|
8780
|
+
}
|
|
8781
|
+
},
|
|
8782
|
+
{ rootMargin: "100px" }
|
|
8783
|
+
);
|
|
8784
|
+
const LazyLoaderInViewContext = React__default.default.createContext(true);
|
|
8785
|
+
function useLazyLoaderIsInView() {
|
|
8786
|
+
return React__default.default.useContext(LazyLoaderInViewContext);
|
|
8787
|
+
}
|
|
8788
|
+
|
|
8591
8789
|
function VizPanelRenderer({ model }) {
|
|
8592
8790
|
var _a;
|
|
8593
8791
|
const {
|
|
@@ -8630,6 +8828,12 @@ function VizPanelRenderer({ model }) {
|
|
|
8630
8828
|
const sceneTimeRange = sceneGraph.getTimeRange(model);
|
|
8631
8829
|
const timeZone = sceneTimeRange.getTimeZone();
|
|
8632
8830
|
const timeRange = model.getTimeRange(dataWithFieldConfig);
|
|
8831
|
+
const isInView = useLazyLoaderIsInView();
|
|
8832
|
+
React.useEffect(() => {
|
|
8833
|
+
if (dataObject.isInViewChanged) {
|
|
8834
|
+
dataObject.isInViewChanged(isInView);
|
|
8835
|
+
}
|
|
8836
|
+
}, [isInView, dataObject]);
|
|
8633
8837
|
const titleInterpolated = model.interpolate(title, void 0, "text");
|
|
8634
8838
|
const alertStateStyles = ui.useStyles2(getAlertStateStyles);
|
|
8635
8839
|
if (!plugin) {
|
|
@@ -9190,6 +9394,14 @@ class SceneDataTransformer extends SceneObjectBase {
|
|
|
9190
9394
|
}
|
|
9191
9395
|
return clone;
|
|
9192
9396
|
}
|
|
9397
|
+
isInViewChanged(isInView) {
|
|
9398
|
+
var _a, _b;
|
|
9399
|
+
(_b = (_a = this.state.$data) == null ? void 0 : _a.isInViewChanged) == null ? void 0 : _b.call(_a, isInView);
|
|
9400
|
+
}
|
|
9401
|
+
bypassIsInViewChanged(bypassIsInView) {
|
|
9402
|
+
var _a, _b;
|
|
9403
|
+
(_b = (_a = this.state.$data) == null ? void 0 : _a.bypassIsInViewChanged) == null ? void 0 : _b.call(_a, bypassIsInView);
|
|
9404
|
+
}
|
|
9193
9405
|
haveAlreadyTransformedData(data) {
|
|
9194
9406
|
if (!this._prevDataFromSource) {
|
|
9195
9407
|
return false;
|
|
@@ -11497,10 +11709,10 @@ class EmbeddedScene extends SceneObjectBase {
|
|
|
11497
11709
|
EmbeddedScene.Component = EmbeddedSceneRenderer;
|
|
11498
11710
|
function EmbeddedSceneRenderer({ model }) {
|
|
11499
11711
|
const { body, controls } = model.useState();
|
|
11500
|
-
const styles = ui.useStyles2(getStyles$
|
|
11712
|
+
const styles = ui.useStyles2(getStyles$6);
|
|
11501
11713
|
return /* @__PURE__ */ React__default.default.createElement("div", { className: styles.container }, controls && /* @__PURE__ */ React__default.default.createElement("div", { className: styles.controls }, controls.map((control) => /* @__PURE__ */ React__default.default.createElement(control.Component, { key: control.state.key, model: control }))), /* @__PURE__ */ React__default.default.createElement("div", { className: styles.body }, /* @__PURE__ */ React__default.default.createElement(body.Component, { model: body })));
|
|
11502
11714
|
}
|
|
11503
|
-
const getStyles$
|
|
11715
|
+
const getStyles$6 = (theme) => {
|
|
11504
11716
|
return {
|
|
11505
11717
|
container: css.css({
|
|
11506
11718
|
flexGrow: 1,
|
|
@@ -11686,67 +11898,6 @@ function isSceneGridLayout(child) {
|
|
|
11686
11898
|
return child instanceof SceneGridLayout;
|
|
11687
11899
|
}
|
|
11688
11900
|
|
|
11689
|
-
function useUniqueId() {
|
|
11690
|
-
var _a;
|
|
11691
|
-
const idRefLazy = React.useRef(void 0);
|
|
11692
|
-
(_a = idRefLazy.current) != null ? _a : idRefLazy.current = lodash.uniqueId();
|
|
11693
|
-
return idRefLazy.current;
|
|
11694
|
-
}
|
|
11695
|
-
const LazyLoader = React__default.default.forwardRef(
|
|
11696
|
-
({ children, onLoad, onChange, className, ...rest }, ref) => {
|
|
11697
|
-
const id = useUniqueId();
|
|
11698
|
-
const { hideEmpty } = ui.useStyles2(getStyles$6);
|
|
11699
|
-
const [loaded, setLoaded] = React.useState(false);
|
|
11700
|
-
const [isInView, setIsInView] = React.useState(false);
|
|
11701
|
-
const innerRef = React.useRef(null);
|
|
11702
|
-
React.useImperativeHandle(ref, () => innerRef.current);
|
|
11703
|
-
reactUse.useEffectOnce(() => {
|
|
11704
|
-
LazyLoader.addCallback(id, (entry) => {
|
|
11705
|
-
if (!loaded && entry.isIntersecting) {
|
|
11706
|
-
setLoaded(true);
|
|
11707
|
-
onLoad == null ? void 0 : onLoad();
|
|
11708
|
-
}
|
|
11709
|
-
setIsInView(entry.isIntersecting);
|
|
11710
|
-
onChange == null ? void 0 : onChange(entry.isIntersecting);
|
|
11711
|
-
});
|
|
11712
|
-
const wrapperEl = innerRef.current;
|
|
11713
|
-
if (wrapperEl) {
|
|
11714
|
-
LazyLoader.observer.observe(wrapperEl);
|
|
11715
|
-
}
|
|
11716
|
-
return () => {
|
|
11717
|
-
wrapperEl && LazyLoader.observer.unobserve(wrapperEl);
|
|
11718
|
-
delete LazyLoader.callbacks[id];
|
|
11719
|
-
if (Object.keys(LazyLoader.callbacks).length === 0) {
|
|
11720
|
-
LazyLoader.observer.disconnect();
|
|
11721
|
-
}
|
|
11722
|
-
};
|
|
11723
|
-
});
|
|
11724
|
-
return /* @__PURE__ */ React__default.default.createElement("div", { id, ref: innerRef, className: `${hideEmpty} ${className}`, ...rest }, !loaded || !isInView ? i18n.t("grafana-scenes.components.lazy-loader.placeholder", "\xA0") : children);
|
|
11725
|
-
}
|
|
11726
|
-
);
|
|
11727
|
-
function getStyles$6() {
|
|
11728
|
-
return {
|
|
11729
|
-
hideEmpty: css.css({
|
|
11730
|
-
"&:empty": {
|
|
11731
|
-
display: "none"
|
|
11732
|
-
}
|
|
11733
|
-
})
|
|
11734
|
-
};
|
|
11735
|
-
}
|
|
11736
|
-
LazyLoader.displayName = "LazyLoader";
|
|
11737
|
-
LazyLoader.callbacks = {};
|
|
11738
|
-
LazyLoader.addCallback = (id, c) => LazyLoader.callbacks[id] = c;
|
|
11739
|
-
LazyLoader.observer = new IntersectionObserver(
|
|
11740
|
-
(entries) => {
|
|
11741
|
-
for (const entry of entries) {
|
|
11742
|
-
if (typeof LazyLoader.callbacks[entry.target.id] === "function") {
|
|
11743
|
-
LazyLoader.callbacks[entry.target.id](entry);
|
|
11744
|
-
}
|
|
11745
|
-
}
|
|
11746
|
-
},
|
|
11747
|
-
{ rootMargin: "100px" }
|
|
11748
|
-
);
|
|
11749
|
-
|
|
11750
11901
|
function SceneGridLayoutRenderer({ model }) {
|
|
11751
11902
|
const { children, isLazy, isDraggable, isResizable } = model.useState();
|
|
11752
11903
|
const [outerDivRef, { width, height }] = reactUse.useMeasure();
|
|
@@ -15172,6 +15323,7 @@ exports.SceneGridItem = SceneGridItem;
|
|
|
15172
15323
|
exports.SceneGridLayout = SceneGridLayout;
|
|
15173
15324
|
exports.SceneGridLayoutDragStartEvent = SceneGridLayoutDragStartEvent;
|
|
15174
15325
|
exports.SceneGridRow = SceneGridRow;
|
|
15326
|
+
exports.SceneInteractionProfiler = SceneInteractionProfiler;
|
|
15175
15327
|
exports.SceneObjectBase = SceneObjectBase;
|
|
15176
15328
|
exports.SceneObjectRef = SceneObjectRef;
|
|
15177
15329
|
exports.SceneObjectStateChangedEvent = SceneObjectStateChangedEvent;
|