@perses-dev/core 0.0.0-snapshot-scatter-chart-embed-8efdfab → 0.0.0-snapshot-explorer-plugin-c4a7621
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/dist/cjs/index.js +1 -0
- package/dist/cjs/model/calculations.js +8 -8
- package/dist/cjs/model/ephemeraldashboard.js +16 -0
- package/dist/cjs/model/index.js +4 -0
- package/dist/cjs/model/kind.js +1 -0
- package/dist/cjs/model/legend.js +17 -17
- package/dist/cjs/model/query.js +12 -0
- package/dist/cjs/model/resource.js +14 -3
- package/dist/cjs/model/roles.js +4 -3
- package/dist/cjs/model/time.js +27 -26
- package/dist/cjs/model/trace-data.js +29 -1
- package/dist/cjs/model/transforms.js +28 -0
- package/dist/cjs/model/units/bytes.js +1 -4
- package/dist/cjs/model/units/decimal.js +1 -4
- package/dist/cjs/model/units/percent.js +1 -6
- package/dist/cjs/model/units/throughput.js +19 -13
- package/dist/cjs/model/units/time.js +9 -19
- package/dist/cjs/model/units/types.js +0 -13
- package/dist/cjs/model/units/units.js +13 -13
- package/dist/cjs/model/units/utils.js +3 -3
- package/dist/cjs/model/user.js +16 -0
- package/dist/cjs/model/value-mapping.js +16 -0
- package/dist/cjs/model/variables.js +3 -3
- package/dist/cjs/schema/datasource.js +85 -0
- package/dist/cjs/schema/display.js +27 -0
- package/dist/cjs/schema/duration.js +25 -0
- package/dist/cjs/schema/index.js +40 -0
- package/dist/cjs/schema/metadata.js +41 -0
- package/dist/cjs/schema/panel.js +106 -0
- package/dist/cjs/schema/plugin.js +27 -0
- package/dist/cjs/schema/role.js +86 -0
- package/dist/cjs/schema/rolebinding.js +65 -0
- package/dist/cjs/schema/secret.js +174 -0
- package/dist/cjs/schema/user.js +57 -0
- package/dist/cjs/schema/variable.js +171 -0
- package/dist/cjs/utils/fetch.js +20 -26
- package/dist/cjs/utils/index.js +3 -0
- package/dist/cjs/utils/mathjs.js +1 -1
- package/dist/cjs/utils/memo.js +4 -5
- package/dist/cjs/utils/panel-refs.js +4 -4
- package/dist/cjs/utils/regexp.js +54 -0
- package/dist/cjs/utils/text.js +21 -46
- package/dist/cjs/utils/time-series-data.js +5 -5
- package/dist/cjs/utils/transform-data.js +167 -0
- package/dist/cjs/utils/value-mapping.js +105 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/model/calculations.d.ts +4 -4
- package/dist/model/calculations.d.ts.map +1 -1
- package/dist/model/calculations.js +1 -1
- package/dist/model/calculations.js.map +1 -1
- package/dist/model/dashboard.js.map +1 -1
- package/dist/model/datasource.d.ts +15 -8
- package/dist/model/datasource.d.ts.map +1 -1
- package/dist/model/datasource.js +3 -1
- package/dist/model/datasource.js.map +1 -1
- package/dist/model/definitions.d.ts +1 -1
- package/dist/model/definitions.d.ts.map +1 -1
- package/dist/model/definitions.js +3 -0
- package/dist/model/definitions.js.map +1 -1
- package/dist/model/ephemeraldashboard.d.ts +15 -0
- package/dist/model/ephemeraldashboard.d.ts.map +1 -0
- package/dist/model/ephemeraldashboard.js +15 -0
- package/dist/model/ephemeraldashboard.js.map +1 -0
- package/dist/model/http-proxy.js.map +1 -1
- package/dist/model/http.d.ts +6 -1
- package/dist/model/http.d.ts.map +1 -1
- package/dist/model/http.js.map +1 -1
- package/dist/model/index.d.ts +4 -0
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +4 -0
- package/dist/model/index.js.map +1 -1
- package/dist/model/kind.d.ts +1 -1
- package/dist/model/kind.d.ts.map +1 -1
- package/dist/model/kind.js +1 -0
- package/dist/model/kind.js.map +1 -1
- package/dist/model/layout.d.ts +1 -1
- package/dist/model/layout.d.ts.map +1 -1
- package/dist/model/layout.js.map +1 -1
- package/dist/model/legend.d.ts +6 -6
- package/dist/model/legend.d.ts.map +1 -1
- package/dist/model/legend.js.map +1 -1
- package/dist/model/panels.d.ts +17 -1
- package/dist/model/panels.d.ts.map +1 -1
- package/dist/model/panels.js +3 -1
- package/dist/model/panels.js.map +1 -1
- package/dist/model/project.d.ts +5 -0
- package/dist/model/project.d.ts.map +1 -1
- package/dist/model/project.js.map +1 -1
- package/dist/model/query.d.ts +11 -1
- package/dist/model/query.d.ts.map +1 -1
- package/dist/model/query.js +9 -1
- package/dist/model/query.js.map +1 -1
- package/dist/model/resource.d.ts +7 -0
- package/dist/model/resource.d.ts.map +1 -1
- package/dist/model/resource.js +3 -0
- package/dist/model/resource.js.map +1 -1
- package/dist/model/rolebindings.d.ts +1 -1
- package/dist/model/rolebindings.d.ts.map +1 -1
- package/dist/model/rolebindings.js.map +1 -1
- package/dist/model/roles.d.ts +3 -3
- package/dist/model/roles.d.ts.map +1 -1
- package/dist/model/roles.js +1 -0
- package/dist/model/roles.js.map +1 -1
- package/dist/model/secrets.d.ts +1 -1
- package/dist/model/secrets.d.ts.map +1 -1
- package/dist/model/secrets.js.map +1 -1
- package/dist/model/thresholds.js.map +1 -1
- package/dist/model/time-series-data.d.ts +1 -0
- package/dist/model/time-series-data.d.ts.map +1 -1
- package/dist/model/time-series-data.js.map +1 -1
- package/dist/model/time-series-queries.d.ts +3 -3
- package/dist/model/time-series-queries.d.ts.map +1 -1
- package/dist/model/time-series-queries.js.map +1 -1
- package/dist/model/time.d.ts +12 -11
- package/dist/model/time.d.ts.map +1 -1
- package/dist/model/time.js +11 -13
- package/dist/model/time.js.map +1 -1
- package/dist/model/trace-data.d.ts +80 -7
- package/dist/model/trace-data.d.ts.map +1 -1
- package/dist/model/trace-data.js +8 -1
- package/dist/model/trace-data.js.map +1 -1
- package/dist/model/transforms.d.ts +34 -0
- package/dist/model/transforms.d.ts.map +1 -0
- package/dist/model/transforms.js +21 -0
- package/dist/model/transforms.js.map +1 -0
- package/dist/model/units/bytes.d.ts +2 -3
- package/dist/model/units/bytes.d.ts.map +1 -1
- package/dist/model/units/bytes.js +1 -4
- package/dist/model/units/bytes.js.map +1 -1
- package/dist/model/units/decimal.d.ts +2 -3
- package/dist/model/units/decimal.d.ts.map +1 -1
- package/dist/model/units/decimal.js +1 -4
- package/dist/model/units/decimal.js.map +1 -1
- package/dist/model/units/percent.d.ts +2 -3
- package/dist/model/units/percent.d.ts.map +1 -1
- package/dist/model/units/percent.js +1 -6
- package/dist/model/units/percent.js.map +1 -1
- package/dist/model/units/throughput.d.ts +2 -3
- package/dist/model/units/throughput.d.ts.map +1 -1
- package/dist/model/units/throughput.js +19 -13
- package/dist/model/units/throughput.js.map +1 -1
- package/dist/model/units/time.d.ts +2 -3
- package/dist/model/units/time.d.ts.map +1 -1
- package/dist/model/units/time.js +9 -19
- package/dist/model/units/time.js.map +1 -1
- package/dist/model/units/types.d.ts +3 -4
- package/dist/model/units/types.d.ts.map +1 -1
- package/dist/model/units/types.js +1 -7
- package/dist/model/units/types.js.map +1 -1
- package/dist/model/units/units.d.ts +5 -3
- package/dist/model/units/units.d.ts.map +1 -1
- package/dist/model/units/units.js +1 -1
- package/dist/model/units/units.js.map +1 -1
- package/dist/model/units/utils.d.ts.map +1 -1
- package/dist/model/units/utils.js.map +1 -1
- package/dist/model/user.d.ts +21 -0
- package/dist/model/user.d.ts.map +1 -0
- package/dist/model/user.js +15 -0
- package/dist/model/user.js.map +1 -0
- package/dist/model/value-mapping.d.ts +35 -0
- package/dist/model/value-mapping.d.ts.map +1 -0
- package/dist/model/value-mapping.js +15 -0
- package/dist/model/value-mapping.js.map +1 -0
- package/dist/model/variables.d.ts +12 -11
- package/dist/model/variables.d.ts.map +1 -1
- package/dist/model/variables.js.map +1 -1
- package/dist/schema/datasource.d.ts +61 -0
- package/dist/schema/datasource.d.ts.map +1 -0
- package/dist/schema/datasource.js +54 -0
- package/dist/schema/datasource.js.map +1 -0
- package/dist/schema/display.d.ts +12 -0
- package/dist/schema/display.d.ts.map +1 -0
- package/dist/schema/display.js +19 -0
- package/dist/schema/display.js.map +1 -0
- package/dist/schema/duration.d.ts +3 -0
- package/dist/schema/duration.d.ts.map +1 -0
- package/dist/schema/duration.js +17 -0
- package/dist/schema/duration.js.map +1 -0
- package/dist/schema/index.d.ts +12 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +25 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/metadata.d.ts +21 -0
- package/dist/schema/metadata.d.ts.map +1 -0
- package/dist/schema/metadata.js +22 -0
- package/dist/schema/metadata.js.map +1 -0
- package/dist/schema/panel.d.ts +13 -0
- package/dist/schema/panel.d.ts.map +1 -0
- package/dist/schema/panel.js +69 -0
- package/dist/schema/panel.js.map +1 -0
- package/dist/schema/plugin.d.ts +14 -0
- package/dist/schema/plugin.d.ts.map +1 -0
- package/dist/schema/plugin.js +19 -0
- package/dist/schema/plugin.js.map +1 -0
- package/dist/schema/role.d.ts +58 -0
- package/dist/schema/role.d.ts.map +1 -0
- package/dist/schema/role.js +61 -0
- package/dist/schema/role.js.map +1 -0
- package/dist/schema/rolebinding.d.ts +58 -0
- package/dist/schema/rolebinding.d.ts.map +1 -0
- package/dist/schema/rolebinding.js +40 -0
- package/dist/schema/rolebinding.js.map +1 -0
- package/dist/schema/secret.d.ts +1140 -0
- package/dist/schema/secret.d.ts.map +1 -0
- package/dist/schema/secret.js +152 -0
- package/dist/schema/secret.js.map +1 -0
- package/dist/schema/user.d.ts +8 -0
- package/dist/schema/user.d.ts.map +1 -0
- package/dist/schema/user.js +36 -0
- package/dist/schema/user.js.map +1 -0
- package/dist/schema/variable.d.ts +92 -0
- package/dist/schema/variable.d.ts.map +1 -0
- package/dist/schema/variable.js +119 -0
- package/dist/schema/variable.js.map +1 -0
- package/dist/utils/event.js.map +1 -1
- package/dist/utils/fetch.d.ts +5 -2
- package/dist/utils/fetch.d.ts.map +1 -1
- package/dist/utils/fetch.js +15 -21
- package/dist/utils/fetch.js.map +1 -1
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +3 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/is-empty-object.d.ts.map +1 -1
- package/dist/utils/is-empty-object.js.map +1 -1
- package/dist/utils/mathjs.js +1 -1
- package/dist/utils/mathjs.js.map +1 -1
- package/dist/utils/memo.d.ts.map +1 -1
- package/dist/utils/memo.js +1 -2
- package/dist/utils/memo.js.map +1 -1
- package/dist/utils/panel-refs.d.ts +2 -2
- package/dist/utils/panel-refs.d.ts.map +1 -1
- package/dist/utils/panel-refs.js.map +1 -1
- package/dist/utils/regexp.d.ts +11 -0
- package/dist/utils/regexp.d.ts.map +1 -0
- package/dist/utils/regexp.js +42 -0
- package/dist/utils/regexp.js.map +1 -0
- package/dist/utils/text.d.ts +7 -33
- package/dist/utils/text.d.ts.map +1 -1
- package/dist/utils/text.js +21 -52
- package/dist/utils/text.js.map +1 -1
- package/dist/utils/time-series-data.d.ts.map +1 -1
- package/dist/utils/time-series-data.js.map +1 -1
- package/dist/utils/transform-data.d.ts +8 -0
- package/dist/utils/transform-data.d.ts.map +1 -0
- package/dist/utils/transform-data.js +221 -0
- package/dist/utils/transform-data.js.map +1 -0
- package/dist/utils/types.d.ts +1 -1
- package/dist/utils/types.d.ts.map +1 -1
- package/dist/utils/value-mapping.d.ts +3 -0
- package/dist/utils/value-mapping.d.ts.map +1 -0
- package/dist/utils/value-mapping.js +97 -0
- package/dist/utils/value-mapping.js.map +1 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
_export_star(require("./constants"), exports);
|
|
18
18
|
_export_star(require("./model"), exports);
|
|
19
|
+
_export_star(require("./schema"), exports);
|
|
19
20
|
_export_star(require("./utils"), exports);
|
|
20
21
|
function _export_star(from, to) {
|
|
21
22
|
Object.keys(from).forEach(function(k) {
|
|
@@ -21,23 +21,23 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
return
|
|
24
|
+
CALCULATIONS_CONFIG: function() {
|
|
25
|
+
return CALCULATIONS_CONFIG;
|
|
26
26
|
},
|
|
27
27
|
CalculationsMap: function() {
|
|
28
28
|
return CalculationsMap;
|
|
29
29
|
},
|
|
30
|
-
|
|
31
|
-
return
|
|
32
|
-
},
|
|
33
|
-
getCalculations: function() {
|
|
34
|
-
return getCalculations;
|
|
30
|
+
DEFAULT_CALCULATION: function() {
|
|
31
|
+
return DEFAULT_CALCULATION;
|
|
35
32
|
},
|
|
36
33
|
getCalculation: function() {
|
|
37
34
|
return getCalculation;
|
|
35
|
+
},
|
|
36
|
+
getCalculations: function() {
|
|
37
|
+
return getCalculations;
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
|
-
const DEFAULT_CALCULATION = 'last
|
|
40
|
+
const DEFAULT_CALCULATION = 'last'; // aligned with cue
|
|
41
41
|
const CalculationsMap = {
|
|
42
42
|
first: first,
|
|
43
43
|
last: last,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright 2024 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
|
+
});
|
package/dist/cjs/model/index.js
CHANGED
|
@@ -19,6 +19,7 @@ _export_star(require("./dashboard"), exports);
|
|
|
19
19
|
_export_star(require("./datasource"), exports);
|
|
20
20
|
_export_star(require("./definitions"), exports);
|
|
21
21
|
_export_star(require("./display"), exports);
|
|
22
|
+
_export_star(require("./ephemeraldashboard"), exports);
|
|
22
23
|
_export_star(require("./http"), exports);
|
|
23
24
|
_export_star(require("./http-proxy"), exports);
|
|
24
25
|
_export_star(require("./kind"), exports);
|
|
@@ -37,8 +38,11 @@ _export_star(require("./time"), exports);
|
|
|
37
38
|
_export_star(require("./time-series-data"), exports);
|
|
38
39
|
_export_star(require("./time-series-queries"), exports);
|
|
39
40
|
_export_star(require("./trace-data"), exports);
|
|
41
|
+
_export_star(require("./transforms"), exports);
|
|
40
42
|
_export_star(require("./units"), exports);
|
|
43
|
+
_export_star(require("./user"), exports);
|
|
41
44
|
_export_star(require("./variables"), exports);
|
|
45
|
+
_export_star(require("./value-mapping"), exports);
|
|
42
46
|
function _export_star(from, to) {
|
|
43
47
|
Object.keys(from).forEach(function(k) {
|
|
44
48
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
package/dist/cjs/model/kind.js
CHANGED
package/dist/cjs/model/legend.js
CHANGED
|
@@ -25,35 +25,35 @@ function _export(target, all) {
|
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
_export(exports, {
|
|
28
|
-
|
|
29
|
-
return
|
|
28
|
+
DEFAULT_LEGEND: function() {
|
|
29
|
+
return DEFAULT_LEGEND;
|
|
30
30
|
},
|
|
31
|
-
|
|
32
|
-
return
|
|
31
|
+
getLegendMode: function() {
|
|
32
|
+
return getLegendMode;
|
|
33
33
|
},
|
|
34
|
-
|
|
35
|
-
return
|
|
34
|
+
getLegendPosition: function() {
|
|
35
|
+
return getLegendPosition;
|
|
36
36
|
},
|
|
37
|
-
|
|
38
|
-
return
|
|
37
|
+
getLegendSize: function() {
|
|
38
|
+
return getLegendSize;
|
|
39
39
|
},
|
|
40
40
|
isValidLegendMode: function() {
|
|
41
41
|
return isValidLegendMode;
|
|
42
42
|
},
|
|
43
|
+
isValidLegendPosition: function() {
|
|
44
|
+
return isValidLegendPosition;
|
|
45
|
+
},
|
|
43
46
|
isValidLegendSize: function() {
|
|
44
47
|
return isValidLegendSize;
|
|
45
48
|
},
|
|
46
|
-
|
|
47
|
-
return
|
|
48
|
-
},
|
|
49
|
-
getLegendPosition: function() {
|
|
50
|
-
return getLegendPosition;
|
|
49
|
+
legendModes: function() {
|
|
50
|
+
return legendModes;
|
|
51
51
|
},
|
|
52
|
-
|
|
53
|
-
return
|
|
52
|
+
legendPositions: function() {
|
|
53
|
+
return legendPositions;
|
|
54
54
|
},
|
|
55
|
-
|
|
56
|
-
return
|
|
55
|
+
legendSizes: function() {
|
|
56
|
+
return legendSizes;
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
59
|
const legendPositions = [
|
package/dist/cjs/model/query.js
CHANGED
|
@@ -14,3 +14,15 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
+
Object.defineProperty(exports, "isValidQueryPluginType", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return isValidQueryPluginType;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
function isValidQueryPluginType(type) {
|
|
24
|
+
return [
|
|
25
|
+
'TimeSeriesQuery',
|
|
26
|
+
'TraceQuery'
|
|
27
|
+
].includes(type);
|
|
28
|
+
}
|
|
@@ -14,12 +14,23 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
getMetadataProject: function() {
|
|
20
25
|
return getMetadataProject;
|
|
26
|
+
},
|
|
27
|
+
isProjectMetadata: function() {
|
|
28
|
+
return isProjectMetadata;
|
|
21
29
|
}
|
|
22
30
|
});
|
|
31
|
+
function isProjectMetadata(metadata) {
|
|
32
|
+
return 'project' in metadata;
|
|
33
|
+
}
|
|
23
34
|
function getMetadataProject(metadata) {
|
|
24
35
|
return 'project' in metadata ? metadata.project : undefined;
|
|
25
36
|
}
|
package/dist/cjs/model/roles.js
CHANGED
|
@@ -24,11 +24,11 @@ _export(exports, {
|
|
|
24
24
|
ACTIONS: function() {
|
|
25
25
|
return ACTIONS;
|
|
26
26
|
},
|
|
27
|
-
PROJECT_SCOPES: function() {
|
|
28
|
-
return PROJECT_SCOPES;
|
|
29
|
-
},
|
|
30
27
|
GLOBAL_SCOPES: function() {
|
|
31
28
|
return GLOBAL_SCOPES;
|
|
29
|
+
},
|
|
30
|
+
PROJECT_SCOPES: function() {
|
|
31
|
+
return PROJECT_SCOPES;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
const ACTIONS = [
|
|
@@ -42,6 +42,7 @@ const PROJECT_SCOPES = [
|
|
|
42
42
|
'*',
|
|
43
43
|
'Dashboard',
|
|
44
44
|
'Datasource',
|
|
45
|
+
'EphemeralDashboard',
|
|
45
46
|
'Folder',
|
|
46
47
|
'Project',
|
|
47
48
|
'Role',
|
package/dist/cjs/model/time.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -21,35 +21,38 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
return
|
|
24
|
+
DURATION_REGEX: function() {
|
|
25
|
+
return DURATION_REGEX;
|
|
26
26
|
},
|
|
27
|
-
|
|
28
|
-
return
|
|
27
|
+
formatDuration: function() {
|
|
28
|
+
return formatDuration;
|
|
29
29
|
},
|
|
30
|
-
|
|
31
|
-
return
|
|
30
|
+
getSuggestedStepMs: function() {
|
|
31
|
+
return getSuggestedStepMs;
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
return
|
|
33
|
+
intervalToPrometheusDuration: function() {
|
|
34
|
+
return intervalToPrometheusDuration;
|
|
35
|
+
},
|
|
36
|
+
isAbsoluteTimeRange: function() {
|
|
37
|
+
return isAbsoluteTimeRange;
|
|
35
38
|
},
|
|
36
39
|
isDurationString: function() {
|
|
37
40
|
return isDurationString;
|
|
38
41
|
},
|
|
39
|
-
|
|
40
|
-
return
|
|
42
|
+
isRelativeTimeRange: function() {
|
|
43
|
+
return isRelativeTimeRange;
|
|
41
44
|
},
|
|
42
45
|
msToPrometheusDuration: function() {
|
|
43
46
|
return msToPrometheusDuration;
|
|
44
47
|
},
|
|
45
|
-
|
|
46
|
-
return
|
|
48
|
+
parseDurationString: function() {
|
|
49
|
+
return parseDurationString;
|
|
47
50
|
},
|
|
48
51
|
roundStepInterval: function() {
|
|
49
52
|
return roundStepInterval;
|
|
50
53
|
},
|
|
51
|
-
|
|
52
|
-
return
|
|
54
|
+
toAbsoluteTimeRange: function() {
|
|
55
|
+
return toAbsoluteTimeRange;
|
|
53
56
|
}
|
|
54
57
|
});
|
|
55
58
|
const _datefns = require("date-fns");
|
|
@@ -66,8 +69,7 @@ function isAbsoluteTimeRange(timeRange) {
|
|
|
66
69
|
return timeRange.start !== undefined && timeRange.end !== undefined;
|
|
67
70
|
}
|
|
68
71
|
function toAbsoluteTimeRange(timeRange) {
|
|
69
|
-
|
|
70
|
-
const end = (_timeRange_end = timeRange.end) !== null && _timeRange_end !== void 0 ? _timeRange_end : new Date();
|
|
72
|
+
const end = timeRange.end ?? new Date();
|
|
71
73
|
return {
|
|
72
74
|
start: (0, _datefns.sub)(end, parseDurationString(timeRange.pastDuration)),
|
|
73
75
|
end
|
|
@@ -79,15 +81,14 @@ function parseDurationString(durationString) {
|
|
|
79
81
|
if (matches === null) {
|
|
80
82
|
throw new Error(`Invalid duration string '${durationString}'`);
|
|
81
83
|
}
|
|
82
|
-
var _matches_, _matches_1, _matches_2, _matches_3, _matches_4, _matches_5, _matches_6;
|
|
83
84
|
return {
|
|
84
|
-
years: parseInt(
|
|
85
|
+
years: parseInt(matches[1] ?? '0'),
|
|
85
86
|
months: 0,
|
|
86
|
-
weeks: parseInt(
|
|
87
|
-
days: parseInt(
|
|
88
|
-
hours: parseInt(
|
|
89
|
-
minutes: parseInt(
|
|
90
|
-
seconds: parseInt(
|
|
87
|
+
weeks: parseInt(matches[2] ?? '0'),
|
|
88
|
+
days: parseInt(matches[3] ?? '0'),
|
|
89
|
+
hours: parseInt(matches[4] ?? '0'),
|
|
90
|
+
minutes: parseInt(matches[5] ?? '0'),
|
|
91
|
+
seconds: parseInt(matches[6] ?? '0') + parseInt(matches[7] ?? '0') / 1000
|
|
91
92
|
};
|
|
92
93
|
}
|
|
93
94
|
function isDurationString(maybeDuration) {
|
|
@@ -141,7 +142,7 @@ function formatDuration(duration) {
|
|
|
141
142
|
if (seconds) {
|
|
142
143
|
result.push(`${seconds}s`);
|
|
143
144
|
}
|
|
144
|
-
const ms = (duration.seconds - seconds) * 1000;
|
|
145
|
+
const ms = Math.round((duration.seconds - seconds) * 1000);
|
|
145
146
|
if (ms) {
|
|
146
147
|
result.push(`${ms}ms`);
|
|
147
148
|
}
|
|
@@ -326,7 +327,7 @@ const ROUNDED_STEP_INTERVALS = [
|
|
|
326
327
|
}
|
|
327
328
|
];
|
|
328
329
|
function roundStepInterval(stepMs) {
|
|
329
|
-
for (const { maxMs
|
|
330
|
+
for (const { maxMs, roundedStepMs } of ROUNDED_STEP_INTERVALS){
|
|
330
331
|
if (stepMs < maxMs) {
|
|
331
332
|
return roundedStepMs;
|
|
332
333
|
}
|
|
@@ -10,7 +10,35 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Common types
|
|
15
|
+
*/ "use strict";
|
|
14
16
|
Object.defineProperty(exports, "__esModule", {
|
|
15
17
|
value: true
|
|
16
18
|
});
|
|
19
|
+
function _export(target, all) {
|
|
20
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: all[name]
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
_export(exports, {
|
|
26
|
+
SpanStatusError: function() {
|
|
27
|
+
return SpanStatusError;
|
|
28
|
+
},
|
|
29
|
+
SpanStatusOk: function() {
|
|
30
|
+
return SpanStatusOk;
|
|
31
|
+
},
|
|
32
|
+
SpanStatusUnset: function() {
|
|
33
|
+
return SpanStatusUnset;
|
|
34
|
+
},
|
|
35
|
+
isValidTraceId: function() {
|
|
36
|
+
return isValidTraceId;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const SpanStatusUnset = 'STATUS_CODE_UNSET';
|
|
40
|
+
const SpanStatusOk = 'STATUS_CODE_OK';
|
|
41
|
+
const SpanStatusError = 'STATUS_CODE_ERROR';
|
|
42
|
+
function isValidTraceId(traceId) {
|
|
43
|
+
return /^[0-9a-fA-F]+$/.test(traceId);
|
|
44
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright 2024 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, "TRANSFORM_TEXT", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return TRANSFORM_TEXT;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const TRANSFORM_TEXT = {
|
|
24
|
+
JoinByColumnValue: 'Join by column value',
|
|
25
|
+
MergeColumns: 'Merge columns',
|
|
26
|
+
MergeIndexedColumns: 'Merge indexed columns',
|
|
27
|
+
MergeSeries: 'Merge series'
|
|
28
|
+
};
|
|
@@ -46,9 +46,6 @@ function _interop_require_default(obj) {
|
|
|
46
46
|
* 1 MB = 1,000,000 bytes (1000^2 bytes)
|
|
47
47
|
* etc.
|
|
48
48
|
*/ const DEFAULT_NUMBRO_MANTISSA = 2;
|
|
49
|
-
const bytesUnits = [
|
|
50
|
-
'bytes'
|
|
51
|
-
];
|
|
52
49
|
const BYTES_GROUP_CONFIG = {
|
|
53
50
|
label: 'Bytes',
|
|
54
51
|
decimalPlaces: true,
|
|
@@ -60,7 +57,7 @@ const BYTES_UNIT_CONFIG = {
|
|
|
60
57
|
label: 'Bytes'
|
|
61
58
|
}
|
|
62
59
|
};
|
|
63
|
-
function formatBytes(bytes, { shortValues
|
|
60
|
+
function formatBytes(bytes, { shortValues, decimalPlaces }) {
|
|
64
61
|
// If we're showing the entire value, we can use Intl.NumberFormat.
|
|
65
62
|
if (!(0, _utils.shouldShortenValues)(shortValues) || Math.abs(bytes) < 1000) {
|
|
66
63
|
const formatterOptions = {
|
|
@@ -33,9 +33,6 @@ _export(exports, {
|
|
|
33
33
|
});
|
|
34
34
|
const _constants = require("./constants");
|
|
35
35
|
const _utils = require("./utils");
|
|
36
|
-
const decimalUnits = [
|
|
37
|
-
'decimal'
|
|
38
|
-
];
|
|
39
36
|
const DECIMAL_GROUP_CONFIG = {
|
|
40
37
|
label: 'Decimal',
|
|
41
38
|
decimalPlaces: true,
|
|
@@ -47,7 +44,7 @@ const DECIMAL_UNIT_CONFIG = {
|
|
|
47
44
|
label: 'Decimal'
|
|
48
45
|
}
|
|
49
46
|
};
|
|
50
|
-
function formatDecimal(value, { shortValues
|
|
47
|
+
function formatDecimal(value, { shortValues, decimalPlaces }) {
|
|
51
48
|
const formatterOptions = {
|
|
52
49
|
style: 'decimal',
|
|
53
50
|
useGrouping: true
|
|
@@ -33,11 +33,6 @@ _export(exports, {
|
|
|
33
33
|
});
|
|
34
34
|
const _constants = require("./constants");
|
|
35
35
|
const _utils = require("./utils");
|
|
36
|
-
const percentUnits = [
|
|
37
|
-
'percent',
|
|
38
|
-
'percent-decimal',
|
|
39
|
-
'%'
|
|
40
|
-
];
|
|
41
36
|
const PERCENT_GROUP_CONFIG = {
|
|
42
37
|
label: 'percent',
|
|
43
38
|
decimalPlaces: true
|
|
@@ -60,7 +55,7 @@ const PERCENT_UNIT_CONFIG = {
|
|
|
60
55
|
label: '%'
|
|
61
56
|
}
|
|
62
57
|
};
|
|
63
|
-
function formatPercent(value, { unit
|
|
58
|
+
function formatPercent(value, { unit, decimalPlaces }) {
|
|
64
59
|
const formatterOptions = {
|
|
65
60
|
style: 'percent',
|
|
66
61
|
useGrouping: true
|
|
@@ -31,26 +31,23 @@ _export(exports, {
|
|
|
31
31
|
return formatThroughput;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
+
const _bytes = require("./bytes");
|
|
34
35
|
const _constants = require("./constants");
|
|
35
36
|
const _utils = require("./utils");
|
|
36
|
-
const throughputUnits = [
|
|
37
|
-
'counts/sec',
|
|
38
|
-
'events/sec',
|
|
39
|
-
'messages/sec',
|
|
40
|
-
'ops/sec',
|
|
41
|
-
'packets/sec',
|
|
42
|
-
'reads/sec',
|
|
43
|
-
'records/sec',
|
|
44
|
-
'requests/sec',
|
|
45
|
-
'rows/sec',
|
|
46
|
-
'writes/sec'
|
|
47
|
-
];
|
|
48
37
|
const THROUGHPUT_GROUP_CONFIG = {
|
|
49
38
|
label: 'Throughput',
|
|
50
39
|
decimalPlaces: true
|
|
51
40
|
};
|
|
52
41
|
const THROUGHPUT_GROUP = 'Throughput';
|
|
53
42
|
const THROUGHPUT_UNIT_CONFIG = {
|
|
43
|
+
'bits/sec': {
|
|
44
|
+
group: THROUGHPUT_GROUP,
|
|
45
|
+
label: 'Bits/sec'
|
|
46
|
+
},
|
|
47
|
+
'bytes/sec': {
|
|
48
|
+
group: THROUGHPUT_GROUP,
|
|
49
|
+
label: 'Bytes/sec'
|
|
50
|
+
},
|
|
54
51
|
'counts/sec': {
|
|
55
52
|
group: THROUGHPUT_GROUP,
|
|
56
53
|
label: 'Counts/sec'
|
|
@@ -92,7 +89,16 @@ const THROUGHPUT_UNIT_CONFIG = {
|
|
|
92
89
|
label: 'Writes/sec'
|
|
93
90
|
}
|
|
94
91
|
};
|
|
95
|
-
function formatThroughput(value, { unit
|
|
92
|
+
function formatThroughput(value, { unit, shortValues, decimalPlaces }) {
|
|
93
|
+
// special case for data throughput
|
|
94
|
+
if (unit === 'bytes/sec') {
|
|
95
|
+
const denominator = Math.abs(value) < 1000 ? 'sec' : 's';
|
|
96
|
+
return (0, _bytes.formatBytes)(value, {
|
|
97
|
+
unit: 'bytes',
|
|
98
|
+
shortValues,
|
|
99
|
+
decimalPlaces
|
|
100
|
+
}) + '/' + denominator;
|
|
101
|
+
}
|
|
96
102
|
const formatterOptions = {
|
|
97
103
|
style: 'decimal',
|
|
98
104
|
useGrouping: true
|
|
@@ -36,16 +36,6 @@ _export(exports, {
|
|
|
36
36
|
});
|
|
37
37
|
const _constants = require("./constants");
|
|
38
38
|
const _utils = require("./utils");
|
|
39
|
-
const timeUnits = [
|
|
40
|
-
'milliseconds',
|
|
41
|
-
'seconds',
|
|
42
|
-
'minutes',
|
|
43
|
-
'hours',
|
|
44
|
-
'days',
|
|
45
|
-
'weeks',
|
|
46
|
-
'months',
|
|
47
|
-
'years'
|
|
48
|
-
];
|
|
49
39
|
const TIME_GROUP = 'Time';
|
|
50
40
|
const TIME_GROUP_CONFIG = {
|
|
51
41
|
label: 'Time',
|
|
@@ -87,14 +77,14 @@ const TIME_UNIT_CONFIG = {
|
|
|
87
77
|
};
|
|
88
78
|
var PersesTimeToIntlTime;
|
|
89
79
|
(function(PersesTimeToIntlTime) {
|
|
90
|
-
PersesTimeToIntlTime["milliseconds"] =
|
|
91
|
-
PersesTimeToIntlTime["seconds"] =
|
|
92
|
-
PersesTimeToIntlTime["minutes"] =
|
|
93
|
-
PersesTimeToIntlTime["hours"] =
|
|
94
|
-
PersesTimeToIntlTime["days"] =
|
|
95
|
-
PersesTimeToIntlTime["weeks"] =
|
|
96
|
-
PersesTimeToIntlTime["months"] =
|
|
97
|
-
PersesTimeToIntlTime["years"] =
|
|
80
|
+
PersesTimeToIntlTime["milliseconds"] = "millisecond";
|
|
81
|
+
PersesTimeToIntlTime["seconds"] = "second";
|
|
82
|
+
PersesTimeToIntlTime["minutes"] = "minute";
|
|
83
|
+
PersesTimeToIntlTime["hours"] = "hour";
|
|
84
|
+
PersesTimeToIntlTime["days"] = "day";
|
|
85
|
+
PersesTimeToIntlTime["weeks"] = "week";
|
|
86
|
+
PersesTimeToIntlTime["months"] = "month";
|
|
87
|
+
PersesTimeToIntlTime["years"] = "year";
|
|
98
88
|
})(PersesTimeToIntlTime || (PersesTimeToIntlTime = {}));
|
|
99
89
|
/**
|
|
100
90
|
* Note: This conversion will not be exactly accurate for months and years,
|
|
@@ -147,7 +137,7 @@ const LARGEST_TO_SMALLEST_TIME_UNITS = [
|
|
|
147
137
|
function isMonthOrYear(unit) {
|
|
148
138
|
return unit === 'months' || unit === 'years';
|
|
149
139
|
}
|
|
150
|
-
function formatTime(value, { unit
|
|
140
|
+
function formatTime(value, { unit, decimalPlaces }) {
|
|
151
141
|
if (value === 0) return '0s';
|
|
152
142
|
const results = getValueAndKindForNaturalNumbers(value, unit);
|
|
153
143
|
const formatterOptions = {
|
|
@@ -16,16 +16,3 @@
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", {
|
|
17
17
|
value: true
|
|
18
18
|
});
|
|
19
|
-
Object.defineProperty(exports, "UNIT_GROUPS", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function() {
|
|
22
|
-
return UNIT_GROUPS;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
const UNIT_GROUPS = [
|
|
26
|
-
'Time',
|
|
27
|
-
'Percent',
|
|
28
|
-
'Decimal',
|
|
29
|
-
'Bytes',
|
|
30
|
-
'Throughput'
|
|
31
|
-
];
|
|
@@ -21,12 +21,12 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
UNIT_GROUP_CONFIG: function() {
|
|
25
|
-
return UNIT_GROUP_CONFIG;
|
|
26
|
-
},
|
|
27
24
|
UNIT_CONFIG: function() {
|
|
28
25
|
return UNIT_CONFIG;
|
|
29
26
|
},
|
|
27
|
+
UNIT_GROUP_CONFIG: function() {
|
|
28
|
+
return UNIT_GROUP_CONFIG;
|
|
29
|
+
},
|
|
30
30
|
formatValue: function() {
|
|
31
31
|
return formatValue;
|
|
32
32
|
},
|
|
@@ -39,26 +39,26 @@ _export(exports, {
|
|
|
39
39
|
getUnitGroupConfig: function() {
|
|
40
40
|
return getUnitGroupConfig;
|
|
41
41
|
},
|
|
42
|
-
|
|
43
|
-
return
|
|
42
|
+
isBytesUnit: function() {
|
|
43
|
+
return isBytesUnit;
|
|
44
|
+
},
|
|
45
|
+
isDecimalUnit: function() {
|
|
46
|
+
return isDecimalUnit;
|
|
44
47
|
},
|
|
45
48
|
isPercentUnit: function() {
|
|
46
49
|
return isPercentUnit;
|
|
47
50
|
},
|
|
48
|
-
|
|
49
|
-
return
|
|
51
|
+
isThroughputUnit: function() {
|
|
52
|
+
return isThroughputUnit;
|
|
50
53
|
},
|
|
51
|
-
|
|
52
|
-
return
|
|
54
|
+
isTimeUnit: function() {
|
|
55
|
+
return isTimeUnit;
|
|
53
56
|
},
|
|
54
57
|
isUnitWithDecimalPlaces: function() {
|
|
55
58
|
return isUnitWithDecimalPlaces;
|
|
56
59
|
},
|
|
57
60
|
isUnitWithShortValues: function() {
|
|
58
61
|
return isUnitWithShortValues;
|
|
59
|
-
},
|
|
60
|
-
isThroughputUnit: function() {
|
|
61
|
-
return isThroughputUnit;
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
64
|
const _bytes = require("./bytes");
|
|
@@ -133,5 +133,5 @@ function isUnitWithShortValues(formatOptions) {
|
|
|
133
133
|
return !!groupConfig.shortValues;
|
|
134
134
|
}
|
|
135
135
|
function isThroughputUnit(formatOptions) {
|
|
136
|
-
return getUnitGroup(formatOptions)
|
|
136
|
+
return getUnitGroup(formatOptions) === 'Throughput';
|
|
137
137
|
}
|
|
@@ -21,14 +21,14 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
shouldShortenValues: function() {
|
|
25
|
-
return shouldShortenValues;
|
|
26
|
-
},
|
|
27
24
|
hasDecimalPlaces: function() {
|
|
28
25
|
return hasDecimalPlaces;
|
|
29
26
|
},
|
|
30
27
|
limitDecimalPlaces: function() {
|
|
31
28
|
return limitDecimalPlaces;
|
|
29
|
+
},
|
|
30
|
+
shouldShortenValues: function() {
|
|
31
|
+
return shouldShortenValues;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
function shouldShortenValues(shortValues) {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright 2024 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
|
+
});
|