@perses-dev/tracing-gantt-chart-plugin 0.13.0 → 0.14.0-beta.2
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/__mf/js/{TracingGanttChart.ca3d72b7.js → TracingGanttChart.4460ff1c.js} +4 -4
- package/__mf/js/async/121.5b3411ef.js +2 -0
- package/__mf/js/async/192.b0550d58.js +1 -0
- package/__mf/js/async/2.2a545358.js +1 -0
- package/__mf/js/async/235.831bea3e.js +1 -0
- package/__mf/js/async/247.e4d2c197.js +1 -0
- package/__mf/js/async/274.eee92e86.js +2 -0
- package/__mf/js/async/356.43c6ada2.js +1 -0
- package/__mf/js/async/392.a3f49cf0.js +2 -0
- package/__mf/js/async/407.6e0c3fb4.js +4 -0
- package/__mf/js/async/407.6e0c3fb4.js.LICENSE.txt +9 -0
- package/__mf/js/async/43.cbae1eef.js +2 -0
- package/__mf/js/async/436.4db73a03.js +110 -0
- package/__mf/js/async/470.8d6cfc01.js +2 -0
- package/__mf/js/async/496.9a3d3d3d.js +1 -0
- package/__mf/js/async/587.849f1255.js +1 -0
- package/__mf/js/async/588.39275df8.js +1 -0
- package/__mf/js/async/616.4d217c10.js +1 -0
- package/__mf/js/async/665.2b61216d.js +2 -0
- package/__mf/js/async/672.790df7d1.js +1 -0
- package/__mf/js/async/71.4eb8fa2f.js +1 -0
- package/__mf/js/async/77.27ff39b8.js +1 -0
- package/__mf/js/async/776.f19f62f3.js +43 -0
- package/__mf/js/async/{30.991f7ee4.js.LICENSE.txt → 776.f19f62f3.js.LICENSE.txt} +41 -1
- package/__mf/js/async/873.a00a9302.js +1 -0
- package/__mf/js/async/941.7ee2dbf0.js +2 -0
- package/__mf/js/async/968.b61d3c02.js +1 -0
- package/__mf/js/async/978.4227a27e.js +1 -0
- package/__mf/js/async/__federation_expose_TracingGanttChart.303e7806.js +1 -0
- package/__mf/js/async/lib-router.a8607481.js +2 -0
- package/__mf/js/{main.9e057781.js → main.7b791d2a.js} +2 -2
- package/lib/PanelActions.d.ts +3 -3
- package/lib/PanelActions.d.ts.map +1 -1
- package/lib/PanelActions.js +4 -4
- package/lib/PanelActions.js.map +1 -1
- package/lib/TracingGanttChart/DetailPane/Attributes.d.ts +4 -4
- package/lib/TracingGanttChart/DetailPane/Attributes.d.ts.map +1 -1
- package/lib/TracingGanttChart/DetailPane/Attributes.js +4 -4
- package/lib/TracingGanttChart/DetailPane/Attributes.js.map +1 -1
- package/lib/TracingGanttChart/DetailPane/DetailPane.d.ts +3 -3
- package/lib/TracingGanttChart/DetailPane/DetailPane.d.ts.map +1 -1
- package/lib/TracingGanttChart/DetailPane/DetailPane.js +6 -6
- package/lib/TracingGanttChart/DetailPane/DetailPane.js.map +1 -1
- package/lib/TracingGanttChart/DetailPane/SpanEvents.d.ts +3 -3
- package/lib/TracingGanttChart/DetailPane/SpanEvents.d.ts.map +1 -1
- package/lib/TracingGanttChart/DetailPane/SpanEvents.js +7 -7
- package/lib/TracingGanttChart/DetailPane/SpanEvents.js.map +1 -1
- package/lib/TracingGanttChart/DetailPane/SpanLinks.d.ts +3 -3
- package/lib/TracingGanttChart/DetailPane/SpanLinks.d.ts.map +1 -1
- package/lib/TracingGanttChart/DetailPane/SpanLinks.js +4 -4
- package/lib/TracingGanttChart/DetailPane/SpanLinks.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTable.d.ts +4 -4
- package/lib/TracingGanttChart/GanttTable/GanttTable.d.ts.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTable.js +8 -8
- package/lib/TracingGanttChart/GanttTable/GanttTable.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTableHeader.d.ts +3 -3
- package/lib/TracingGanttChart/GanttTable/GanttTableHeader.d.ts.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTableHeader.js +3 -3
- package/lib/TracingGanttChart/GanttTable/GanttTableHeader.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTableProvider.d.ts +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTableProvider.d.ts.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTableProvider.js +2 -2
- package/lib/TracingGanttChart/GanttTable/GanttTableProvider.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTableRow.d.ts +3 -3
- package/lib/TracingGanttChart/GanttTable/GanttTableRow.d.ts.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTableRow.js +5 -5
- package/lib/TracingGanttChart/GanttTable/GanttTableRow.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.d.ts +1 -1
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.d.ts.map +1 -1
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.js +3 -3
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/SpanDuration.d.ts +4 -4
- package/lib/TracingGanttChart/GanttTable/SpanDuration.d.ts.map +1 -1
- package/lib/TracingGanttChart/GanttTable/SpanDuration.js +4 -4
- package/lib/TracingGanttChart/GanttTable/SpanDuration.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/SpanIndents.d.ts +2 -2
- package/lib/TracingGanttChart/GanttTable/SpanIndents.d.ts.map +1 -1
- package/lib/TracingGanttChart/GanttTable/SpanIndents.js +5 -5
- package/lib/TracingGanttChart/GanttTable/SpanIndents.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/SpanLinksButton.d.ts +3 -3
- package/lib/TracingGanttChart/GanttTable/SpanLinksButton.d.ts.map +1 -1
- package/lib/TracingGanttChart/GanttTable/SpanLinksButton.js +5 -5
- package/lib/TracingGanttChart/GanttTable/SpanLinksButton.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/SpanName.d.ts +3 -3
- package/lib/TracingGanttChart/GanttTable/SpanName.d.ts.map +1 -1
- package/lib/TracingGanttChart/GanttTable/SpanName.js +5 -5
- package/lib/TracingGanttChart/GanttTable/SpanName.js.map +1 -1
- package/lib/TracingGanttChart/MiniGanttChart/Canvas.d.ts +4 -4
- package/lib/TracingGanttChart/MiniGanttChart/Canvas.d.ts.map +1 -1
- package/lib/TracingGanttChart/MiniGanttChart/Canvas.js +8 -8
- package/lib/TracingGanttChart/MiniGanttChart/Canvas.js.map +1 -1
- package/lib/TracingGanttChart/MiniGanttChart/MiniGanttChart.d.ts +4 -4
- package/lib/TracingGanttChart/MiniGanttChart/MiniGanttChart.d.ts.map +1 -1
- package/lib/TracingGanttChart/MiniGanttChart/MiniGanttChart.js +4 -4
- package/lib/TracingGanttChart/MiniGanttChart/MiniGanttChart.js.map +1 -1
- package/lib/TracingGanttChart/MiniGanttChart/draw.d.ts +1 -1
- package/lib/TracingGanttChart/MiniGanttChart/draw.d.ts.map +1 -1
- package/lib/TracingGanttChart/MiniGanttChart/draw.js +2 -2
- package/lib/TracingGanttChart/MiniGanttChart/draw.js.map +1 -1
- package/lib/TracingGanttChart/Search.d.ts +2 -2
- package/lib/TracingGanttChart/Search.d.ts.map +1 -1
- package/lib/TracingGanttChart/Search.js +7 -7
- package/lib/TracingGanttChart/Search.js.map +1 -1
- package/lib/TracingGanttChart/Ticks.d.ts +3 -3
- package/lib/TracingGanttChart/Ticks.d.ts.map +1 -1
- package/lib/TracingGanttChart/Ticks.js +3 -3
- package/lib/TracingGanttChart/Ticks.js.map +1 -1
- package/lib/TracingGanttChart/TraceHeaderBar.d.ts +3 -3
- package/lib/TracingGanttChart/TraceHeaderBar.d.ts.map +1 -1
- package/lib/TracingGanttChart/TraceHeaderBar.js +6 -6
- package/lib/TracingGanttChart/TraceHeaderBar.js.map +1 -1
- package/lib/TracingGanttChart/TracingGanttChart.d.ts +3 -3
- package/lib/TracingGanttChart/TracingGanttChart.d.ts.map +1 -1
- package/lib/TracingGanttChart/TracingGanttChart.js +13 -11
- package/lib/TracingGanttChart/TracingGanttChart.js.map +1 -1
- package/lib/TracingGanttChart/palette.js +1 -1
- package/lib/TracingGanttChart/palette.js.map +1 -1
- package/lib/TracingGanttChart/trace.d.ts +2 -2
- package/lib/TracingGanttChart/trace.d.ts.map +1 -1
- package/lib/TracingGanttChart/trace.js +1 -1
- package/lib/TracingGanttChart/trace.js.map +1 -1
- package/lib/TracingGanttChart/utils.d.ts +3 -3
- package/lib/TracingGanttChart/utils.d.ts.map +1 -1
- package/lib/TracingGanttChart/utils.js +2 -2
- package/lib/TracingGanttChart/utils.js.map +1 -1
- package/lib/TracingGanttChart.d.ts +3 -3
- package/lib/TracingGanttChart.d.ts.map +1 -1
- package/lib/TracingGanttChart.js +3 -3
- package/lib/TracingGanttChart.js.map +1 -1
- package/lib/TracingGanttChartPanel.d.ts +4 -4
- package/lib/TracingGanttChartPanel.d.ts.map +1 -1
- package/lib/TracingGanttChartPanel.js +4 -4
- package/lib/TracingGanttChartPanel.js.map +1 -1
- package/lib/bootstrap.js +2 -2
- package/lib/getPluginModule.d.ts +1 -1
- package/lib/getPluginModule.d.ts.map +1 -1
- package/lib/getPluginModule.js +3 -1
- package/lib/getPluginModule.js.map +1 -1
- package/lib/index-federation.js +1 -1
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/lib/setup-tests.d.ts +1 -1
- package/lib/setup-tests.d.ts.map +1 -1
- package/lib/setup-tests.js +2 -2
- package/lib/setup-tests.js.map +1 -1
- package/lib/test/convert/jaeger.d.ts +1 -1
- package/lib/test/convert/jaeger.d.ts.map +1 -1
- package/lib/test/convert/jaeger.js.map +1 -1
- package/mf-manifest.json +35 -34
- package/mf-stats.json +35 -34
- package/package.json +10 -10
- package/__mf/js/async/121.1fc97c57.js +0 -2
- package/__mf/js/async/177.27fced63.js +0 -1
- package/__mf/js/async/192.ea308602.js +0 -1
- package/__mf/js/async/193.6692daa9.js +0 -1
- package/__mf/js/async/2.c5f68593.js +0 -1
- package/__mf/js/async/235.4f4ad5f0.js +0 -1
- package/__mf/js/async/274.03fc3289.js +0 -2
- package/__mf/js/async/30.991f7ee4.js +0 -39
- package/__mf/js/async/356.2e3c02c9.js +0 -1
- package/__mf/js/async/392.eb9b3bb9.js +0 -2
- package/__mf/js/async/43.b9d7bc56.js +0 -2
- package/__mf/js/async/47.514dc87f.js +0 -1
- package/__mf/js/async/470.9743e21d.js +0 -2
- package/__mf/js/async/546.b40699cb.js +0 -24
- package/__mf/js/async/546.b40699cb.js.LICENSE.txt +0 -19
- package/__mf/js/async/570.9d51e826.js +0 -7
- package/__mf/js/async/570.9d51e826.js.LICENSE.txt +0 -39
- package/__mf/js/async/581.aa52d024.js +0 -1
- package/__mf/js/async/587.f49a06d9.js +0 -1
- package/__mf/js/async/588.46394f24.js +0 -1
- package/__mf/js/async/616.09a93b54.js +0 -1
- package/__mf/js/async/71.f0d71a40.js +0 -1
- package/__mf/js/async/873.34370b2c.js +0 -1
- package/__mf/js/async/887.027eb62b.js +0 -110
- package/__mf/js/async/941.3d671d54.js +0 -2
- package/__mf/js/async/968.1ac51448.js +0 -1
- package/__mf/js/async/978.0c50ecf5.js +0 -1
- package/__mf/js/async/__federation_expose_TracingGanttChart.9c074bea.js +0 -1
- package/__mf/js/async/lib-router.5f492283.js +0 -2
- package/lib/cjs/PanelActions.js +0 -88
- package/lib/cjs/TracingGanttChart/DetailPane/Attributes.js +0 -204
- package/lib/cjs/TracingGanttChart/DetailPane/DetailPane.js +0 -129
- package/lib/cjs/TracingGanttChart/DetailPane/SpanEvents.js +0 -113
- package/lib/cjs/TracingGanttChart/DetailPane/SpanLinks.js +0 -72
- package/lib/cjs/TracingGanttChart/GanttTable/GanttTable.js +0 -154
- package/lib/cjs/TracingGanttChart/GanttTable/GanttTableHeader.js +0 -64
- package/lib/cjs/TracingGanttChart/GanttTable/GanttTableProvider.js +0 -60
- package/lib/cjs/TracingGanttChart/GanttTable/GanttTableRow.js +0 -77
- package/lib/cjs/TracingGanttChart/GanttTable/ResizableDivider.js +0 -98
- package/lib/cjs/TracingGanttChart/GanttTable/SpanDuration.js +0 -81
- package/lib/cjs/TracingGanttChart/GanttTable/SpanIndents.js +0 -97
- package/lib/cjs/TracingGanttChart/GanttTable/SpanLinksButton.js +0 -108
- package/lib/cjs/TracingGanttChart/GanttTable/SpanName.js +0 -83
- package/lib/cjs/TracingGanttChart/MiniGanttChart/Canvas.js +0 -256
- package/lib/cjs/TracingGanttChart/MiniGanttChart/MiniGanttChart.js +0 -59
- package/lib/cjs/TracingGanttChart/MiniGanttChart/draw.js +0 -45
- package/lib/cjs/TracingGanttChart/Search.js +0 -154
- package/lib/cjs/TracingGanttChart/Ticks.js +0 -106
- package/lib/cjs/TracingGanttChart/TraceHeaderBar.js +0 -159
- package/lib/cjs/TracingGanttChart/TracingGanttChart.js +0 -122
- package/lib/cjs/TracingGanttChart/palette.js +0 -83
- package/lib/cjs/TracingGanttChart/trace.js +0 -137
- package/lib/cjs/TracingGanttChart/utils.js +0 -117
- package/lib/cjs/TracingGanttChart.js +0 -37
- package/lib/cjs/TracingGanttChartPanel.js +0 -66
- package/lib/cjs/bootstrap.js +0 -26
- package/lib/cjs/env.d.js +0 -14
- package/lib/cjs/gantt-chart-model.js +0 -28
- package/lib/cjs/getPluginModule.js +0 -39
- package/lib/cjs/index-federation.js +0 -55
- package/lib/cjs/index.js +0 -39
- package/lib/cjs/setup-tests.js +0 -19
- package/lib/cjs/test/convert/jaeger.js +0 -86
- /package/__mf/css/async/{570.85c2cbf6.css → 776.85c2cbf6.css} +0 -0
- /package/__mf/js/async/{121.1fc97c57.js.LICENSE.txt → 121.5b3411ef.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{274.03fc3289.js.LICENSE.txt → 274.eee92e86.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.eb9b3bb9.js.LICENSE.txt → 392.a3f49cf0.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{43.b9d7bc56.js.LICENSE.txt → 43.cbae1eef.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{887.027eb62b.js.LICENSE.txt → 436.4db73a03.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{470.9743e21d.js.LICENSE.txt → 470.8d6cfc01.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.3d671d54.js.LICENSE.txt → 941.7ee2dbf0.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{lib-router.5f492283.js.LICENSE.txt → lib-router.a8607481.js.LICENSE.txt} +0 -0
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(exports, "TraceHeaderBar", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return TraceHeaderBar;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _material = require("@mui/material");
|
|
25
|
-
const _Magnify = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Magnify"));
|
|
26
|
-
const _react = require("react");
|
|
27
|
-
const _components = require("@perses-dev/components");
|
|
28
|
-
const _utils = require("./utils");
|
|
29
|
-
const _Search = require("./Search");
|
|
30
|
-
function _interop_require_default(obj) {
|
|
31
|
-
return obj && obj.__esModule ? obj : {
|
|
32
|
-
default: obj
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
const DATE_FORMAT_OPTIONS = {
|
|
36
|
-
year: 'numeric',
|
|
37
|
-
month: 'long',
|
|
38
|
-
day: 'numeric',
|
|
39
|
-
hour: 'numeric',
|
|
40
|
-
minute: 'numeric',
|
|
41
|
-
second: 'numeric',
|
|
42
|
-
fractionalSecondDigits: 3
|
|
43
|
-
};
|
|
44
|
-
const dateFormatterUTC = new Intl.DateTimeFormat(undefined, {
|
|
45
|
-
...DATE_FORMAT_OPTIONS,
|
|
46
|
-
timeZone: 'UTC',
|
|
47
|
-
timeZoneName: 'short'
|
|
48
|
-
}).format;
|
|
49
|
-
function TraceHeaderBar(props) {
|
|
50
|
-
const { trace, search } = props;
|
|
51
|
-
const { dateFormatOptionsWithUserTimeZone } = (0, _components.useTimeZone)();
|
|
52
|
-
const dateFormatter = (0, _react.useMemo)(()=>{
|
|
53
|
-
const dateFormatOptions = dateFormatOptionsWithUserTimeZone(DATE_FORMAT_OPTIONS);
|
|
54
|
-
return new Intl.DateTimeFormat(undefined, dateFormatOptions).format;
|
|
55
|
-
}, [
|
|
56
|
-
dateFormatOptionsWithUserTimeZone
|
|
57
|
-
]);
|
|
58
|
-
const [showSearch, setShowSearch] = (0, _react.useState)(false);
|
|
59
|
-
const rootSpan = trace.rootSpans[0];
|
|
60
|
-
if (!rootSpan) {
|
|
61
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
62
|
-
children: "Trace contains no spans."
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
66
|
-
direction: "column",
|
|
67
|
-
sx: {
|
|
68
|
-
gap: 1
|
|
69
|
-
},
|
|
70
|
-
children: [
|
|
71
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
72
|
-
direction: "row",
|
|
73
|
-
sx: {
|
|
74
|
-
gap: 1,
|
|
75
|
-
justifyContent: 'space-between',
|
|
76
|
-
flexWrap: 'wrap'
|
|
77
|
-
},
|
|
78
|
-
children: [
|
|
79
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
80
|
-
direction: "row",
|
|
81
|
-
sx: {
|
|
82
|
-
gap: 1,
|
|
83
|
-
alignItems: 'center'
|
|
84
|
-
},
|
|
85
|
-
children: [
|
|
86
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
|
|
87
|
-
variant: "h3",
|
|
88
|
-
children: [
|
|
89
|
-
rootSpan.resource.serviceName,
|
|
90
|
-
": ",
|
|
91
|
-
rootSpan.name,
|
|
92
|
-
" (",
|
|
93
|
-
(0, _utils.formatDuration)(trace.endTimeUnixMs - trace.startTimeUnixMs),
|
|
94
|
-
")"
|
|
95
|
-
]
|
|
96
|
-
}),
|
|
97
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
98
|
-
size: "small",
|
|
99
|
-
onClick: ()=>setShowSearch((prev)=>!prev),
|
|
100
|
-
"aria-label": "Toggle search",
|
|
101
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Magnify.default, {
|
|
102
|
-
fontSize: "small"
|
|
103
|
-
})
|
|
104
|
-
})
|
|
105
|
-
]
|
|
106
|
-
}),
|
|
107
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
108
|
-
direction: "row",
|
|
109
|
-
sx: {
|
|
110
|
-
rowGap: 1,
|
|
111
|
-
columnGap: 2,
|
|
112
|
-
alignItems: 'center',
|
|
113
|
-
flexWrap: 'wrap'
|
|
114
|
-
},
|
|
115
|
-
children: [
|
|
116
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
|
|
117
|
-
variant: "h4",
|
|
118
|
-
sx: {
|
|
119
|
-
fontWeight: 'normal'
|
|
120
|
-
},
|
|
121
|
-
children: [
|
|
122
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("strong", {
|
|
123
|
-
children: "Start:"
|
|
124
|
-
}),
|
|
125
|
-
' ',
|
|
126
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Tooltip, {
|
|
127
|
-
title: dateFormatterUTC(trace.startTimeUnixMs),
|
|
128
|
-
placement: "top",
|
|
129
|
-
arrow: true,
|
|
130
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
131
|
-
component: "span",
|
|
132
|
-
children: dateFormatter(trace.startTimeUnixMs)
|
|
133
|
-
})
|
|
134
|
-
})
|
|
135
|
-
]
|
|
136
|
-
}),
|
|
137
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
|
|
138
|
-
variant: "h4",
|
|
139
|
-
sx: {
|
|
140
|
-
fontWeight: 'normal'
|
|
141
|
-
},
|
|
142
|
-
children: [
|
|
143
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("strong", {
|
|
144
|
-
children: "Trace ID:"
|
|
145
|
-
}),
|
|
146
|
-
" ",
|
|
147
|
-
rootSpan.traceId
|
|
148
|
-
]
|
|
149
|
-
})
|
|
150
|
-
]
|
|
151
|
-
})
|
|
152
|
-
]
|
|
153
|
-
}),
|
|
154
|
-
showSearch && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Search.SearchBar, {
|
|
155
|
-
search: search
|
|
156
|
-
})
|
|
157
|
-
]
|
|
158
|
-
});
|
|
159
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(exports, "TracingGanttChart", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return TracingGanttChart;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _react = require("react");
|
|
25
|
-
const _material = require("@mui/material");
|
|
26
|
-
const _MiniGanttChart = require("./MiniGanttChart/MiniGanttChart");
|
|
27
|
-
const _DetailPane = require("./DetailPane/DetailPane");
|
|
28
|
-
const _GanttTable = require("./GanttTable/GanttTable");
|
|
29
|
-
const _GanttTableProvider = require("./GanttTable/GanttTableProvider");
|
|
30
|
-
const _ResizableDivider = require("./GanttTable/ResizableDivider");
|
|
31
|
-
const _trace = require("./trace");
|
|
32
|
-
const _TraceHeaderBar = require("./TraceHeaderBar");
|
|
33
|
-
const _Search = require("./Search");
|
|
34
|
-
function TracingGanttChart(props) {
|
|
35
|
-
const { options, customLinks, trace: otlpTrace } = props;
|
|
36
|
-
const trace = (0, _react.useMemo)(()=>{
|
|
37
|
-
try {
|
|
38
|
-
return (0, _trace.getTraceModel)(otlpTrace);
|
|
39
|
-
} catch (e) {
|
|
40
|
-
throw new Error(`Error: unable to parse trace: ${e}`);
|
|
41
|
-
}
|
|
42
|
-
}, [
|
|
43
|
-
otlpTrace
|
|
44
|
-
]);
|
|
45
|
-
const [viewport, setViewport] = (0, _react.useState)({
|
|
46
|
-
startTimeUnixMs: trace.startTimeUnixMs,
|
|
47
|
-
endTimeUnixMs: trace.endTimeUnixMs
|
|
48
|
-
});
|
|
49
|
-
const [selectedSpan, setSelectedSpan] = (0, _react.useState)(()=>options.selectedSpanId ? trace.spanById.get(options.selectedSpanId) : undefined);
|
|
50
|
-
const search = (0, _Search.useSpanSearch)(trace);
|
|
51
|
-
const ganttChart = (0, _react.useRef)(null);
|
|
52
|
-
// tableWidth only comes to effect if the detail pane is visible.
|
|
53
|
-
// setTableWidth() is only called by <ResizableDivider />
|
|
54
|
-
const [tableWidth, setTableWidth] = (0, _react.useState)(0.82);
|
|
55
|
-
const gap = 2;
|
|
56
|
-
const spacing = ganttChart.current ? parseFloat(getComputedStyle(ganttChart.current).columnGap) || 0 : 0;
|
|
57
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
58
|
-
ref: ganttChart,
|
|
59
|
-
direction: "row",
|
|
60
|
-
sx: {
|
|
61
|
-
height: '100%',
|
|
62
|
-
minHeight: '240px',
|
|
63
|
-
gap
|
|
64
|
-
},
|
|
65
|
-
children: [
|
|
66
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
67
|
-
sx: {
|
|
68
|
-
flexGrow: 1,
|
|
69
|
-
gap
|
|
70
|
-
},
|
|
71
|
-
children: [
|
|
72
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_TraceHeaderBar.TraceHeaderBar, {
|
|
73
|
-
trace: trace,
|
|
74
|
-
search: search
|
|
75
|
-
}),
|
|
76
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_MiniGanttChart.MiniGanttChart, {
|
|
77
|
-
options: options,
|
|
78
|
-
trace: trace,
|
|
79
|
-
viewport: viewport,
|
|
80
|
-
setViewport: setViewport
|
|
81
|
-
}),
|
|
82
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_GanttTableProvider.GanttTableProvider, {
|
|
83
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_GanttTable.GanttTable, {
|
|
84
|
-
options: options,
|
|
85
|
-
customLinks: customLinks,
|
|
86
|
-
trace: trace,
|
|
87
|
-
viewport: viewport,
|
|
88
|
-
selectedSpan: selectedSpan,
|
|
89
|
-
onSpanClick: setSelectedSpan,
|
|
90
|
-
matchingSpanIds: search.matchingSpanIds,
|
|
91
|
-
focusedSpanId: search.matchingSpanIds[search.focusedMatchIndex]
|
|
92
|
-
})
|
|
93
|
-
})
|
|
94
|
-
]
|
|
95
|
-
}),
|
|
96
|
-
selectedSpan && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
97
|
-
children: [
|
|
98
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_ResizableDivider.ResizableDivider, {
|
|
99
|
-
parentRef: ganttChart,
|
|
100
|
-
spacing: spacing,
|
|
101
|
-
onMove: setTableWidth
|
|
102
|
-
}),
|
|
103
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
104
|
-
style: {
|
|
105
|
-
width: `${(1 - tableWidth) * 100}%`,
|
|
106
|
-
minWidth: `${(1 - tableWidth) * 100}%`
|
|
107
|
-
},
|
|
108
|
-
sx: {
|
|
109
|
-
overflow: 'auto'
|
|
110
|
-
},
|
|
111
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DetailPane.DetailPane, {
|
|
112
|
-
customLinks: customLinks,
|
|
113
|
-
trace: trace,
|
|
114
|
-
span: selectedSpan,
|
|
115
|
-
onCloseBtnClick: ()=>setSelectedSpan(undefined)
|
|
116
|
-
})
|
|
117
|
-
})
|
|
118
|
-
]
|
|
119
|
-
})
|
|
120
|
-
]
|
|
121
|
-
});
|
|
122
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
function _export(target, all) {
|
|
18
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
_export(exports, {
|
|
24
|
-
get getConsistentCategoricalColor () {
|
|
25
|
-
return getConsistentCategoricalColor;
|
|
26
|
-
},
|
|
27
|
-
get getConsistentColor () {
|
|
28
|
-
return getConsistentColor;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const _colorhash = /*#__PURE__*/ _interop_require_default(require("color-hash"));
|
|
32
|
-
function _interop_require_default(obj) {
|
|
33
|
-
return obj && obj.__esModule ? obj : {
|
|
34
|
-
default: obj
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
// Valid hue values are 0 to 360 and can be adjusted to control the generated colors.
|
|
38
|
-
// More info: https://github.com/zenozeng/color-hash#custom-hue
|
|
39
|
-
// Picked min of 20 and max of 360 to exclude common threshold colors (red).
|
|
40
|
-
// Items with "error" in them will always be generated as red.
|
|
41
|
-
const ERROR_HUE_CUTOFF = 20;
|
|
42
|
-
const colorGenerator = new _colorhash.default({
|
|
43
|
-
hue: {
|
|
44
|
-
min: ERROR_HUE_CUTOFF,
|
|
45
|
-
max: 360
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
const redColorGenerator = new _colorhash.default({
|
|
49
|
-
hue: {
|
|
50
|
-
min: 0,
|
|
51
|
-
max: ERROR_HUE_CUTOFF
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
function computeConsistentColor(name, error) {
|
|
55
|
-
const [hue, saturation, lightness] = error ? redColorGenerator.hsl(name) : colorGenerator.hsl(name);
|
|
56
|
-
const saturationPercent = `${(saturation * 100).toFixed(0)}%`;
|
|
57
|
-
const lightnessPercent = `${(lightness * 100).toFixed(0)}%`;
|
|
58
|
-
return `hsla(${hue.toFixed(2)},${saturationPercent},${lightnessPercent},0.9)`;
|
|
59
|
-
}
|
|
60
|
-
// To check whether a color has already been generated for a given string.
|
|
61
|
-
// TODO: Predefined color aliases will be defined here
|
|
62
|
-
const colorLookup = {};
|
|
63
|
-
function getConsistentColor(name, error) {
|
|
64
|
-
const key = `${name}_____${error}`;
|
|
65
|
-
let value = colorLookup[key];
|
|
66
|
-
if (!value) {
|
|
67
|
-
value = computeConsistentColor(name, error);
|
|
68
|
-
colorLookup[key] = value;
|
|
69
|
-
}
|
|
70
|
-
return value;
|
|
71
|
-
}
|
|
72
|
-
function getConsistentCategoricalColor(name, error, categoricalPalette, errorPalette) {
|
|
73
|
-
const palette = error ? errorPalette : categoricalPalette;
|
|
74
|
-
if (palette.length === 0) {
|
|
75
|
-
console.warn('getConsistentCategoricalColor() called with empty color palette, fallback to #000');
|
|
76
|
-
return '#000';
|
|
77
|
-
}
|
|
78
|
-
let hash = 0;
|
|
79
|
-
for(let i = 0; i < name.length; i++){
|
|
80
|
-
hash = name.charCodeAt(i) + ((hash << 5) - hash);
|
|
81
|
-
}
|
|
82
|
-
return palette[Math.abs(hash) % palette.length] ?? '#000';
|
|
83
|
-
}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
function _export(target, all) {
|
|
18
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
_export(exports, {
|
|
24
|
-
get forEachSpan () {
|
|
25
|
-
return forEachSpan;
|
|
26
|
-
},
|
|
27
|
-
get getTraceModel () {
|
|
28
|
-
return getTraceModel;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const _lodash = require("lodash");
|
|
32
|
-
function getTraceModel(trace) {
|
|
33
|
-
// first pass: build lookup table <spanId, Span> and compute min/max
|
|
34
|
-
const spanById = new Map();
|
|
35
|
-
const rootSpans = [];
|
|
36
|
-
let startTimeUnixMs = 0;
|
|
37
|
-
let endTimeUnixMs = 0;
|
|
38
|
-
for (const resourceSpan of trace.resourceSpans){
|
|
39
|
-
const resource = parseResource(resourceSpan.resource);
|
|
40
|
-
for (const scopeSpan of resourceSpan.scopeSpans){
|
|
41
|
-
const scope = parseScope(scopeSpan.scope);
|
|
42
|
-
for (const otelSpan of scopeSpan.spans){
|
|
43
|
-
const span = {
|
|
44
|
-
resource,
|
|
45
|
-
scope,
|
|
46
|
-
childSpans: [],
|
|
47
|
-
...parseSpan(otelSpan)
|
|
48
|
-
};
|
|
49
|
-
spanById.set(otelSpan.spanId, span);
|
|
50
|
-
if (startTimeUnixMs === 0 || span.startTimeUnixMs < startTimeUnixMs) {
|
|
51
|
-
startTimeUnixMs = span.startTimeUnixMs;
|
|
52
|
-
}
|
|
53
|
-
if (endTimeUnixMs === 0 || span.endTimeUnixMs > endTimeUnixMs) {
|
|
54
|
-
endTimeUnixMs = span.endTimeUnixMs;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
// second pass: build tree based on parentSpanId property
|
|
60
|
-
for (const [, span] of spanById){
|
|
61
|
-
if (!span.parentSpanId) {
|
|
62
|
-
rootSpans.push(span);
|
|
63
|
-
continue;
|
|
64
|
-
}
|
|
65
|
-
const parent = spanById.get(span.parentSpanId);
|
|
66
|
-
if (!parent) {
|
|
67
|
-
console.trace(`span ${span.spanId} has parent ${span.parentSpanId} which has not been received yet`);
|
|
68
|
-
rootSpans.push(span);
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
span.parentSpan = parent;
|
|
72
|
-
const insertChildSpanAt = (0, _lodash.sortedIndexBy)(parent.childSpans, span, (s)=>s.startTimeUnixMs);
|
|
73
|
-
parent.childSpans.splice(insertChildSpanAt, 0, span);
|
|
74
|
-
}
|
|
75
|
-
return {
|
|
76
|
-
trace,
|
|
77
|
-
rootSpans,
|
|
78
|
-
spanById,
|
|
79
|
-
startTimeUnixMs,
|
|
80
|
-
endTimeUnixMs
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
function forEachSpan(spans, fn) {
|
|
84
|
-
for (const span of spans){
|
|
85
|
-
if (fn(span) !== false) {
|
|
86
|
-
forEachSpan(span.childSpans, fn);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
function parseResource(resource) {
|
|
91
|
-
let serviceName = 'unknown';
|
|
92
|
-
for (const attr of resource?.attributes ?? []){
|
|
93
|
-
if (attr.key === 'service.name' && 'stringValue' in attr.value) {
|
|
94
|
-
serviceName = attr.value.stringValue;
|
|
95
|
-
break;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return {
|
|
99
|
-
serviceName,
|
|
100
|
-
attributes: resource?.attributes ?? []
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
function parseScope(scope) {
|
|
104
|
-
return scope ?? {};
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* parseSpan parses the Span API type to the internal representation
|
|
108
|
-
* i.e. convert strings to numbers etc.
|
|
109
|
-
*/ function parseSpan(span) {
|
|
110
|
-
return {
|
|
111
|
-
traceId: span.traceId,
|
|
112
|
-
spanId: span.spanId,
|
|
113
|
-
parentSpanId: span.parentSpanId,
|
|
114
|
-
name: span.name,
|
|
115
|
-
kind: span.kind,
|
|
116
|
-
startTimeUnixMs: parseInt(span.startTimeUnixNano) * 1e-6,
|
|
117
|
-
endTimeUnixMs: parseInt(span.endTimeUnixNano) * 1e-6,
|
|
118
|
-
attributes: span.attributes ?? [],
|
|
119
|
-
events: (span.events ?? []).map(parseEvent),
|
|
120
|
-
links: (span.links ?? []).map(parseLink),
|
|
121
|
-
status: span.status ?? {}
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
function parseEvent(event) {
|
|
125
|
-
return {
|
|
126
|
-
timeUnixMs: parseInt(event.timeUnixNano) * 1e-6,
|
|
127
|
-
name: event.name,
|
|
128
|
-
attributes: event.attributes ?? []
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
function parseLink(link) {
|
|
132
|
-
return {
|
|
133
|
-
traceId: link.traceId,
|
|
134
|
-
spanId: link.spanId,
|
|
135
|
-
attributes: link.attributes ?? []
|
|
136
|
-
};
|
|
137
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
function _export(target, all) {
|
|
18
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
_export(exports, {
|
|
24
|
-
get formatDuration () {
|
|
25
|
-
return formatDuration;
|
|
26
|
-
},
|
|
27
|
-
get getServiceColor () {
|
|
28
|
-
return getServiceColor;
|
|
29
|
-
},
|
|
30
|
-
get getSpanColor () {
|
|
31
|
-
return getSpanColor;
|
|
32
|
-
},
|
|
33
|
-
get minSpanWidthPx () {
|
|
34
|
-
return minSpanWidthPx;
|
|
35
|
-
},
|
|
36
|
-
get rowHeight () {
|
|
37
|
-
return rowHeight;
|
|
38
|
-
},
|
|
39
|
-
get spanHasError () {
|
|
40
|
-
return spanHasError;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
const _trace = /*#__PURE__*/ _interop_require_wildcard(require("@perses-dev/spec/dist/dashboard/query-type/otlp/trace/v1/trace"));
|
|
44
|
-
const _palette = require("./palette");
|
|
45
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
46
|
-
if (typeof WeakMap !== "function") return null;
|
|
47
|
-
var cacheBabelInterop = new WeakMap();
|
|
48
|
-
var cacheNodeInterop = new WeakMap();
|
|
49
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
50
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
51
|
-
})(nodeInterop);
|
|
52
|
-
}
|
|
53
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
54
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
55
|
-
return obj;
|
|
56
|
-
}
|
|
57
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
58
|
-
return {
|
|
59
|
-
default: obj
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
63
|
-
if (cache && cache.has(obj)) {
|
|
64
|
-
return cache.get(obj);
|
|
65
|
-
}
|
|
66
|
-
var newObj = {
|
|
67
|
-
__proto__: null
|
|
68
|
-
};
|
|
69
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
70
|
-
for(var key in obj){
|
|
71
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
72
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
73
|
-
if (desc && (desc.get || desc.set)) {
|
|
74
|
-
Object.defineProperty(newObj, key, desc);
|
|
75
|
-
} else {
|
|
76
|
-
newObj[key] = obj[key];
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
newObj.default = obj;
|
|
81
|
-
if (cache) {
|
|
82
|
-
cache.set(obj, newObj);
|
|
83
|
-
}
|
|
84
|
-
return newObj;
|
|
85
|
-
}
|
|
86
|
-
const minSpanWidthPx = 2;
|
|
87
|
-
const rowHeight = '2rem';
|
|
88
|
-
const spanHasError = (span)=>span.status?.code === _trace.StatusCodeError;
|
|
89
|
-
function getServiceColor(muiTheme, chartsTheme, paletteMode, serviceName, error = false) {
|
|
90
|
-
switch(paletteMode){
|
|
91
|
-
case 'categorical':
|
|
92
|
-
{
|
|
93
|
-
// ECharts type for color is not always an array but it is always an array in ChartsProvider
|
|
94
|
-
const categoricalPalette = chartsTheme.echartsTheme.color;
|
|
95
|
-
const errorPalette = [
|
|
96
|
-
muiTheme.palette.error.light,
|
|
97
|
-
muiTheme.palette.error.main,
|
|
98
|
-
muiTheme.palette.error.dark
|
|
99
|
-
];
|
|
100
|
-
return (0, _palette.getConsistentCategoricalColor)(serviceName, error, categoricalPalette, errorPalette);
|
|
101
|
-
}
|
|
102
|
-
default:
|
|
103
|
-
return (0, _palette.getConsistentColor)(serviceName, error);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
function getSpanColor(muiTheme, chartsTheme, paletteMode, span) {
|
|
107
|
-
return getServiceColor(muiTheme, chartsTheme, paletteMode, span.resource.serviceName ?? '', spanHasError(span));
|
|
108
|
-
}
|
|
109
|
-
function formatDuration(timeMs) {
|
|
110
|
-
if (timeMs < 1) {
|
|
111
|
-
return `${Math.round(timeMs * 1000)}μs`;
|
|
112
|
-
}
|
|
113
|
-
if (timeMs < 1000) {
|
|
114
|
-
return `${+timeMs.toFixed(2)}ms`;
|
|
115
|
-
}
|
|
116
|
-
return `${+(timeMs / 1000).toFixed(2)}s`;
|
|
117
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(exports, "TracingGanttChart", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return TracingGanttChart;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _ganttchartmodel = require("./gantt-chart-model");
|
|
24
|
-
const _TracingGanttChartPanel = require("./TracingGanttChartPanel");
|
|
25
|
-
const _PanelActions = require("./PanelActions");
|
|
26
|
-
const TracingGanttChart = {
|
|
27
|
-
PanelComponent: _TracingGanttChartPanel.TracingGanttChartPanel,
|
|
28
|
-
supportedQueryTypes: [
|
|
29
|
-
'TraceQuery'
|
|
30
|
-
],
|
|
31
|
-
createInitialOptions: _ganttchartmodel.createInitialTracingGanttChartOptions,
|
|
32
|
-
actions: [
|
|
33
|
-
{
|
|
34
|
-
component: _PanelActions.DownloadTraceAction
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
};
|