@perses-dev/timeseries-table-plugin 0.6.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/LICENSE +201 -0
- package/README.md +41 -0
- package/__mf/css/async/341.53436797.css +1 -0
- package/__mf/css/async/759.53436797.css +1 -0
- package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
- package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
- package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
- package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
- package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
- package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
- package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
- package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
- package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
- package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
- package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
- package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
- package/__mf/js/795.a00f14d5.js +5 -0
- package/__mf/js/TimeSeriesTable.78b6adc4.js +5 -0
- package/__mf/js/async/156.edaa1366.js +1 -0
- package/__mf/js/async/173.7677c422.js +2 -0
- package/__mf/js/async/173.7677c422.js.LICENSE.txt +19 -0
- package/__mf/js/async/570.4e5c2806.js +1 -0
- package/__mf/js/async/620.989f65d2.js +2 -0
- package/__mf/js/async/620.989f65d2.js.LICENSE.txt +9 -0
- package/__mf/js/async/621.966dfe80.js +111 -0
- package/__mf/js/async/621.966dfe80.js.LICENSE.txt +52 -0
- package/__mf/js/async/651.f2005980.js +1 -0
- package/__mf/js/async/694.46f61549.js +1 -0
- package/__mf/js/async/740.64988389.js +1 -0
- package/__mf/js/async/75.65fec995.js +1 -0
- package/__mf/js/async/770.46d7d5f9.js +1 -0
- package/__mf/js/async/960.d242a960.js +2 -0
- package/__mf/js/async/960.d242a960.js.LICENSE.txt +8 -0
- package/__mf/js/async/964.7386b918.js +2 -0
- package/__mf/js/async/964.7386b918.js.LICENSE.txt +9 -0
- package/__mf/js/async/998.e20cf478.js +65 -0
- package/__mf/js/async/998.e20cf478.js.LICENSE.txt +59 -0
- package/__mf/js/async/__federation_expose_TimeSeriesTable.0774ca0f.js +1 -0
- package/__mf/js/main.857476c9.js +1 -0
- package/lib/TimeSeriesTable.d.ts +8 -0
- package/lib/TimeSeriesTable.d.ts.map +1 -0
- package/lib/TimeSeriesTable.js +29 -0
- package/lib/TimeSeriesTable.js.map +1 -0
- package/lib/TimeSeriesTablePanel.d.ts +7 -0
- package/lib/TimeSeriesTablePanel.d.ts.map +1 -0
- package/lib/TimeSeriesTablePanel.js +33 -0
- package/lib/TimeSeriesTablePanel.js.map +1 -0
- package/lib/bootstrap.d.ts +2 -0
- package/lib/bootstrap.d.ts.map +1 -0
- package/lib/bootstrap.js +19 -0
- package/lib/bootstrap.js.map +1 -0
- package/lib/cjs/TimeSeriesTable.js +35 -0
- package/lib/cjs/TimeSeriesTablePanel.js +41 -0
- package/lib/cjs/bootstrap.js +26 -0
- package/lib/cjs/components/DataTable.js +185 -0
- package/lib/cjs/components/HistogramChart.js +121 -0
- package/lib/cjs/components/SeriesName.js +100 -0
- package/lib/cjs/components/index.js +20 -0
- package/lib/cjs/env.d.js +14 -0
- package/lib/cjs/getPluginModule.js +27 -0
- package/lib/cjs/index-federation.js +55 -0
- package/lib/cjs/index.js +29 -0
- package/lib/cjs/model.js +5 -0
- package/lib/cjs/setup-tests.js +19 -0
- package/lib/cjs/test/mock-query-results.js +417 -0
- package/lib/components/DataTable.d.ts +18 -0
- package/lib/components/DataTable.d.ts.map +1 -0
- package/lib/components/DataTable.js +173 -0
- package/lib/components/DataTable.js.map +1 -0
- package/lib/components/HistogramChart.d.ts +16 -0
- package/lib/components/HistogramChart.d.ts.map +1 -0
- package/lib/components/HistogramChart.js +113 -0
- package/lib/components/HistogramChart.js.map +1 -0
- package/lib/components/SeriesName.d.ts +11 -0
- package/lib/components/SeriesName.d.ts.map +1 -0
- package/lib/components/SeriesName.js +95 -0
- package/lib/components/SeriesName.js.map +1 -0
- package/lib/components/index.d.ts +4 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +5 -0
- package/lib/components/index.js.map +1 -0
- package/lib/env.d.js +15 -0
- package/lib/env.d.js.map +1 -0
- package/lib/getPluginModule.d.ts +6 -0
- package/lib/getPluginModule.d.ts.map +1 -0
- package/lib/getPluginModule.js +16 -0
- package/lib/getPluginModule.js.map +1 -0
- package/lib/index-federation.d.ts +1 -0
- package/lib/index-federation.d.ts.map +1 -0
- package/lib/index-federation.js +15 -0
- package/lib/index-federation.js.map +1 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -0
- package/lib/model.d.ts +3 -0
- package/lib/model.d.ts.map +1 -0
- package/lib/model.js +4 -0
- package/lib/model.js.map +1 -0
- package/lib/setup-tests.d.ts +2 -0
- package/lib/setup-tests.d.ts.map +1 -0
- package/lib/setup-tests.js +17 -0
- package/lib/setup-tests.js.map +1 -0
- package/lib/test/mock-query-results.d.ts +136 -0
- package/lib/test/mock-query-results.d.ts.map +1 -0
- package/lib/test/mock-query-results.js +389 -0
- package/lib/test/mock-query-results.js.map +1 -0
- package/mf-manifest.json +212 -0
- package/mf-stats.json +242 -0
- package/package.json +54 -0
|
@@ -0,0 +1,100 @@
|
|
|
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, "SeriesName", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return SeriesName;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _components = require("@perses-dev/components");
|
|
25
|
+
const _material = require("@mui/material");
|
|
26
|
+
function SeriesName({ name, labels, formattedName, isFormatted }) {
|
|
27
|
+
if (isFormatted && labels && Object.keys(labels).length > 0) {
|
|
28
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(FormatedSeriesName, {
|
|
29
|
+
labels: labels
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
33
|
+
sx: {
|
|
34
|
+
textWrap: 'auto'
|
|
35
|
+
},
|
|
36
|
+
children: formattedName ?? name
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function FormatedSeriesName({ labels }) {
|
|
40
|
+
const { infoSnackbar } = (0, _components.useSnackbar)();
|
|
41
|
+
const labelNodes = [];
|
|
42
|
+
let first = true;
|
|
43
|
+
function copyToClipboard(e) {
|
|
44
|
+
const copyText = e.currentTarget.innerText || '';
|
|
45
|
+
navigator.clipboard.writeText(copyText.trim()).then(()=>{
|
|
46
|
+
infoSnackbar(`Copied label matcher: ${copyText}`);
|
|
47
|
+
}).catch((reason)=>{
|
|
48
|
+
console.error(`unable to copy text: ${reason}`);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
for(const label in labels){
|
|
52
|
+
if (label === '__name__') {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
labelNodes.push(/*#__PURE__*/ (0, _jsxruntime.jsxs)("span", {
|
|
56
|
+
children: [
|
|
57
|
+
!first && ', ',
|
|
58
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
|
|
59
|
+
display: "inline",
|
|
60
|
+
component: "span",
|
|
61
|
+
sx: {
|
|
62
|
+
'&:hover': {
|
|
63
|
+
cursor: 'pointer',
|
|
64
|
+
textDecoration: 'underline'
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
onClick: copyToClipboard,
|
|
68
|
+
title: "Click to copy label matcher",
|
|
69
|
+
children: [
|
|
70
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("strong", {
|
|
71
|
+
children: label
|
|
72
|
+
}),
|
|
73
|
+
"=",
|
|
74
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)("span", {
|
|
75
|
+
children: [
|
|
76
|
+
'"',
|
|
77
|
+
labels[label],
|
|
78
|
+
'"'
|
|
79
|
+
]
|
|
80
|
+
})
|
|
81
|
+
]
|
|
82
|
+
})
|
|
83
|
+
]
|
|
84
|
+
}, label));
|
|
85
|
+
if (first) {
|
|
86
|
+
first = false;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
|
|
90
|
+
sx: {
|
|
91
|
+
textWrap: 'auto'
|
|
92
|
+
},
|
|
93
|
+
children: [
|
|
94
|
+
labels ? labels.__name__ : '',
|
|
95
|
+
'{',
|
|
96
|
+
labelNodes,
|
|
97
|
+
'}'
|
|
98
|
+
]
|
|
99
|
+
});
|
|
100
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
_export_star(require("./DataTable"), exports);
|
|
6
|
+
_export_star(require("./HistogramChart"), exports);
|
|
7
|
+
_export_star(require("./SeriesName"), exports);
|
|
8
|
+
function _export_star(from, to) {
|
|
9
|
+
Object.keys(from).forEach(function(k) {
|
|
10
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
11
|
+
Object.defineProperty(to, k, {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function() {
|
|
14
|
+
return from[k];
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return from;
|
|
20
|
+
}
|
package/lib/cjs/env.d.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
/// <reference types="@rsbuild/core/types" />
|
|
14
|
+
"use strict";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "getPluginModule", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return getPluginModule;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _packagejson = /*#__PURE__*/ _interop_require_default(require("../package.json"));
|
|
12
|
+
function _interop_require_default(obj) {
|
|
13
|
+
return obj && obj.__esModule ? obj : {
|
|
14
|
+
default: obj
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function getPluginModule() {
|
|
18
|
+
const { name, version, perses } = _packagejson.default;
|
|
19
|
+
return {
|
|
20
|
+
kind: 'PluginModule',
|
|
21
|
+
metadata: {
|
|
22
|
+
name,
|
|
23
|
+
version
|
|
24
|
+
},
|
|
25
|
+
spec: perses
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
15
|
+
if (typeof WeakMap !== "function") return null;
|
|
16
|
+
var cacheBabelInterop = new WeakMap();
|
|
17
|
+
var cacheNodeInterop = new WeakMap();
|
|
18
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
19
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
20
|
+
})(nodeInterop);
|
|
21
|
+
}
|
|
22
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
23
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
24
|
+
return obj;
|
|
25
|
+
}
|
|
26
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
27
|
+
return {
|
|
28
|
+
default: obj
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
32
|
+
if (cache && cache.has(obj)) {
|
|
33
|
+
return cache.get(obj);
|
|
34
|
+
}
|
|
35
|
+
var newObj = {
|
|
36
|
+
__proto__: null
|
|
37
|
+
};
|
|
38
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
39
|
+
for(var key in obj){
|
|
40
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
41
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
42
|
+
if (desc && (desc.get || desc.set)) {
|
|
43
|
+
Object.defineProperty(newObj, key, desc);
|
|
44
|
+
} else {
|
|
45
|
+
newObj[key] = obj[key];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
newObj.default = obj;
|
|
50
|
+
if (cache) {
|
|
51
|
+
cache.set(obj, newObj);
|
|
52
|
+
}
|
|
53
|
+
return newObj;
|
|
54
|
+
}
|
|
55
|
+
Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./bootstrap")));
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "getPluginModule", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _getPluginModule.getPluginModule;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
_export_star(require("./components/DataTable"), exports);
|
|
12
|
+
const _getPluginModule = require("./getPluginModule");
|
|
13
|
+
_export_star(require("./model"), exports);
|
|
14
|
+
_export_star(require("./components/SeriesName"), exports);
|
|
15
|
+
_export_star(require("./TimeSeriesTable"), exports);
|
|
16
|
+
_export_star(require("./TimeSeriesTablePanel"), exports);
|
|
17
|
+
function _export_star(from, to) {
|
|
18
|
+
Object.keys(from).forEach(function(k) {
|
|
19
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
20
|
+
Object.defineProperty(to, k, {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function() {
|
|
23
|
+
return from[k];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return from;
|
|
29
|
+
}
|
package/lib/cjs/model.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright 2023 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
|
+
require("@testing-library/jest-dom");
|
|
18
|
+
// Always mock e-charts during tests since we don't have a proper canvas in jsdom
|
|
19
|
+
jest.mock('echarts/core');
|
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
// Copyright 2023 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: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
MOCK_NULL_QUERY_RESULT: function() {
|
|
25
|
+
return MOCK_NULL_QUERY_RESULT;
|
|
26
|
+
},
|
|
27
|
+
MOCK_TIME_SERIES_DATA_MULTIVALUE: function() {
|
|
28
|
+
return MOCK_TIME_SERIES_DATA_MULTIVALUE;
|
|
29
|
+
},
|
|
30
|
+
MOCK_TIME_SERIES_DATA_SINGLEVALUE: function() {
|
|
31
|
+
return MOCK_TIME_SERIES_DATA_SINGLEVALUE;
|
|
32
|
+
},
|
|
33
|
+
MOCK_TIME_SERIES_QUERY_DEFINITION: function() {
|
|
34
|
+
return MOCK_TIME_SERIES_QUERY_DEFINITION;
|
|
35
|
+
},
|
|
36
|
+
MOCK_TIME_SERIES_QUERY_RESULT_MULTIVALUE: function() {
|
|
37
|
+
return MOCK_TIME_SERIES_QUERY_RESULT_MULTIVALUE;
|
|
38
|
+
},
|
|
39
|
+
MOCK_TIME_SERIES_QUERY_RESULT_SINGLEVALUE: function() {
|
|
40
|
+
return MOCK_TIME_SERIES_QUERY_RESULT_SINGLEVALUE;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const MOCK_TIME_SERIES_QUERY_RESULT_MULTIVALUE = [
|
|
44
|
+
{
|
|
45
|
+
status: 'success',
|
|
46
|
+
fetchStatus: 'idle',
|
|
47
|
+
isLoading: false,
|
|
48
|
+
isSuccess: true,
|
|
49
|
+
isError: false,
|
|
50
|
+
data: {
|
|
51
|
+
timeRange: {
|
|
52
|
+
start: new Date(1666625490000),
|
|
53
|
+
end: new Date(1666625535000)
|
|
54
|
+
},
|
|
55
|
+
stepMs: 24379,
|
|
56
|
+
series: [
|
|
57
|
+
{
|
|
58
|
+
name: 'device="/dev/vda1", env="demo", fstype="ext4", instance="demo.do.prometheus.io:9100", job="node", mountpoint="/"',
|
|
59
|
+
values: [
|
|
60
|
+
[
|
|
61
|
+
1666479357903,
|
|
62
|
+
0.27700745551584494
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
1666479382282,
|
|
66
|
+
0.27701284657366565
|
|
67
|
+
]
|
|
68
|
+
],
|
|
69
|
+
labels: {
|
|
70
|
+
device: '/dev/vda1',
|
|
71
|
+
env: 'demo',
|
|
72
|
+
fstype: 'ext4',
|
|
73
|
+
instance: 'demo.do.prometheus.io:9100',
|
|
74
|
+
job: 'node',
|
|
75
|
+
mountpoint: '/'
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'device="/dev/vda15", env="demo", fstype="vfat", instance="demo.do.prometheus.io:9100", job="node", mountpoint="/boot/efi"',
|
|
80
|
+
values: [
|
|
81
|
+
[
|
|
82
|
+
1666479357903,
|
|
83
|
+
0.08486496097624885
|
|
84
|
+
],
|
|
85
|
+
[
|
|
86
|
+
1666479382282,
|
|
87
|
+
0.08486496097624885
|
|
88
|
+
]
|
|
89
|
+
],
|
|
90
|
+
labels: {
|
|
91
|
+
device: '/dev/vda15',
|
|
92
|
+
env: 'demo',
|
|
93
|
+
fstype: 'vfat',
|
|
94
|
+
instance: 'demo.do.prometheus.io:9100',
|
|
95
|
+
job: 'node',
|
|
96
|
+
mountpoint: '/boot/efi'
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
dataUpdatedAt: 1666500979895,
|
|
102
|
+
error: null,
|
|
103
|
+
errorUpdatedAt: 0,
|
|
104
|
+
failureCount: 0,
|
|
105
|
+
errorUpdateCount: 0,
|
|
106
|
+
isFetched: true,
|
|
107
|
+
isFetchedAfterMount: true,
|
|
108
|
+
isFetching: false,
|
|
109
|
+
isRefetching: false,
|
|
110
|
+
isLoadingError: false,
|
|
111
|
+
isPaused: false,
|
|
112
|
+
isPlaceholderData: false,
|
|
113
|
+
isPreviousData: false,
|
|
114
|
+
isRefetchError: false,
|
|
115
|
+
isStale: true
|
|
116
|
+
}
|
|
117
|
+
];
|
|
118
|
+
const MOCK_TIME_SERIES_QUERY_RESULT_SINGLEVALUE = [
|
|
119
|
+
{
|
|
120
|
+
status: 'success',
|
|
121
|
+
fetchStatus: 'idle',
|
|
122
|
+
isLoading: false,
|
|
123
|
+
isSuccess: true,
|
|
124
|
+
isError: false,
|
|
125
|
+
data: {
|
|
126
|
+
timeRange: {
|
|
127
|
+
start: new Date(1666625535000),
|
|
128
|
+
end: new Date(1666625535000)
|
|
129
|
+
},
|
|
130
|
+
stepMs: 24379,
|
|
131
|
+
series: [
|
|
132
|
+
{
|
|
133
|
+
name: 'device="/dev/vda1", env="demo", fstype="ext4", instance="demo.do.prometheus.io:9100", job="node", mountpoint="/"',
|
|
134
|
+
values: [
|
|
135
|
+
[
|
|
136
|
+
1666479357903,
|
|
137
|
+
0.27700745551584494
|
|
138
|
+
]
|
|
139
|
+
],
|
|
140
|
+
labels: {
|
|
141
|
+
device: '/dev/vda1',
|
|
142
|
+
env: 'demo',
|
|
143
|
+
fstype: 'ext4',
|
|
144
|
+
instance: 'demo.do.prometheus.io:9100',
|
|
145
|
+
job: 'node',
|
|
146
|
+
mountpoint: '/'
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: 'device="/dev/vda15", env="demo", fstype="vfat", instance="demo.do.prometheus.io:9100", job="node", mountpoint="/boot/efi"',
|
|
151
|
+
values: [
|
|
152
|
+
[
|
|
153
|
+
1666479357903,
|
|
154
|
+
0.08486496097624885
|
|
155
|
+
]
|
|
156
|
+
],
|
|
157
|
+
labels: {
|
|
158
|
+
device: '/dev/vda15',
|
|
159
|
+
env: 'demo',
|
|
160
|
+
fstype: 'vfat',
|
|
161
|
+
instance: 'demo.do.prometheus.io:9100',
|
|
162
|
+
job: 'node',
|
|
163
|
+
mountpoint: '/boot/efi'
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
dataUpdatedAt: 1666500979895,
|
|
169
|
+
error: null,
|
|
170
|
+
errorUpdatedAt: 0,
|
|
171
|
+
failureCount: 0,
|
|
172
|
+
errorUpdateCount: 0,
|
|
173
|
+
isFetched: true,
|
|
174
|
+
isFetchedAfterMount: true,
|
|
175
|
+
isFetching: false,
|
|
176
|
+
isRefetching: false,
|
|
177
|
+
isLoadingError: false,
|
|
178
|
+
isPaused: false,
|
|
179
|
+
isPlaceholderData: false,
|
|
180
|
+
isPreviousData: false,
|
|
181
|
+
isRefetchError: false,
|
|
182
|
+
isStale: true
|
|
183
|
+
}
|
|
184
|
+
];
|
|
185
|
+
const MOCK_TIME_SERIES_DATA_MULTIVALUE = {
|
|
186
|
+
timeRange: {
|
|
187
|
+
start: new Date(1666625490000),
|
|
188
|
+
end: new Date(1666625535000)
|
|
189
|
+
},
|
|
190
|
+
stepMs: 24379,
|
|
191
|
+
series: [
|
|
192
|
+
{
|
|
193
|
+
name: 'device="/dev/vda1", env="demo", fstype="ext4", instance="demo.do.prometheus.io:9100", job="node", mountpoint="/"',
|
|
194
|
+
values: [
|
|
195
|
+
[
|
|
196
|
+
1666479357903,
|
|
197
|
+
0.27700745551584494
|
|
198
|
+
],
|
|
199
|
+
[
|
|
200
|
+
1666479382282,
|
|
201
|
+
0.27701284657366565
|
|
202
|
+
]
|
|
203
|
+
],
|
|
204
|
+
labels: {
|
|
205
|
+
device: '/dev/vda1',
|
|
206
|
+
env: 'demo',
|
|
207
|
+
fstype: 'ext4',
|
|
208
|
+
instance: 'demo.do.prometheus.io:9100',
|
|
209
|
+
job: 'node',
|
|
210
|
+
mountpoint: '/'
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
name: 'device="/dev/vda15", env="demo", fstype="vfat", instance="demo.do.prometheus.io:9100", job="node", mountpoint="/boot/efi"',
|
|
215
|
+
values: [
|
|
216
|
+
[
|
|
217
|
+
1666479357903,
|
|
218
|
+
0.08486496097624885
|
|
219
|
+
],
|
|
220
|
+
[
|
|
221
|
+
1666479382282,
|
|
222
|
+
0.08486496097624885
|
|
223
|
+
]
|
|
224
|
+
],
|
|
225
|
+
labels: {
|
|
226
|
+
device: '/dev/vda15',
|
|
227
|
+
env: 'demo',
|
|
228
|
+
fstype: 'vfat',
|
|
229
|
+
instance: 'demo.do.prometheus.io:9100',
|
|
230
|
+
job: 'node',
|
|
231
|
+
mountpoint: '/boot/efi'
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
]
|
|
235
|
+
};
|
|
236
|
+
const MOCK_TIME_SERIES_DATA_SINGLEVALUE = {
|
|
237
|
+
timeRange: {
|
|
238
|
+
start: new Date(1666625535000),
|
|
239
|
+
end: new Date(1666625535000)
|
|
240
|
+
},
|
|
241
|
+
stepMs: 24379,
|
|
242
|
+
series: [
|
|
243
|
+
{
|
|
244
|
+
name: 'device="/dev/vda1", env="demo", fstype="ext4", instance="demo.do.prometheus.io:9100", job="node", mountpoint="/"',
|
|
245
|
+
values: [
|
|
246
|
+
[
|
|
247
|
+
1666479357903,
|
|
248
|
+
0.27700745551584494
|
|
249
|
+
]
|
|
250
|
+
],
|
|
251
|
+
labels: {
|
|
252
|
+
device: '/dev/vda1',
|
|
253
|
+
env: 'demo',
|
|
254
|
+
fstype: 'ext4',
|
|
255
|
+
instance: 'demo.do.prometheus.io:9100',
|
|
256
|
+
job: 'node',
|
|
257
|
+
mountpoint: '/'
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
name: 'device="/dev/vda15", env="demo", fstype="vfat", instance="demo.do.prometheus.io:9100", job="node", mountpoint="/boot/efi"',
|
|
262
|
+
values: [
|
|
263
|
+
[
|
|
264
|
+
1666479357903,
|
|
265
|
+
0.08486496097624885
|
|
266
|
+
]
|
|
267
|
+
],
|
|
268
|
+
labels: {
|
|
269
|
+
device: '/dev/vda15',
|
|
270
|
+
env: 'demo',
|
|
271
|
+
fstype: 'vfat',
|
|
272
|
+
instance: 'demo.do.prometheus.io:9100',
|
|
273
|
+
job: 'node',
|
|
274
|
+
mountpoint: '/boot/efi'
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
]
|
|
278
|
+
};
|
|
279
|
+
const MOCK_NULL_QUERY_RESULT = [
|
|
280
|
+
{
|
|
281
|
+
status: 'success',
|
|
282
|
+
fetchStatus: 'idle',
|
|
283
|
+
isLoading: false,
|
|
284
|
+
isSuccess: true,
|
|
285
|
+
isError: false,
|
|
286
|
+
data: {
|
|
287
|
+
timeRange: {
|
|
288
|
+
start: new Date(1677376110000),
|
|
289
|
+
end: new Date(1677376410000)
|
|
290
|
+
},
|
|
291
|
+
stepMs: 15000,
|
|
292
|
+
series: [
|
|
293
|
+
{
|
|
294
|
+
name: 'node_memory_Buffers_bytes{env="demo",instance="demo.do.prometheus.io:9100",job="node"}',
|
|
295
|
+
values: [
|
|
296
|
+
[
|
|
297
|
+
1677376110000,
|
|
298
|
+
40000000
|
|
299
|
+
],
|
|
300
|
+
[
|
|
301
|
+
1677376125000,
|
|
302
|
+
40000000
|
|
303
|
+
],
|
|
304
|
+
[
|
|
305
|
+
1677376140000,
|
|
306
|
+
null
|
|
307
|
+
],
|
|
308
|
+
[
|
|
309
|
+
1677376155000,
|
|
310
|
+
null
|
|
311
|
+
],
|
|
312
|
+
[
|
|
313
|
+
1677376170000,
|
|
314
|
+
null
|
|
315
|
+
],
|
|
316
|
+
[
|
|
317
|
+
1677376185000,
|
|
318
|
+
null
|
|
319
|
+
],
|
|
320
|
+
[
|
|
321
|
+
1677376200000,
|
|
322
|
+
null
|
|
323
|
+
],
|
|
324
|
+
[
|
|
325
|
+
1677376215000,
|
|
326
|
+
40013824
|
|
327
|
+
],
|
|
328
|
+
[
|
|
329
|
+
1677376230000,
|
|
330
|
+
40038400
|
|
331
|
+
],
|
|
332
|
+
[
|
|
333
|
+
1677376245000,
|
|
334
|
+
40054784
|
|
335
|
+
],
|
|
336
|
+
[
|
|
337
|
+
1677376260000,
|
|
338
|
+
40071168
|
|
339
|
+
],
|
|
340
|
+
[
|
|
341
|
+
1677376275000,
|
|
342
|
+
40075264
|
|
343
|
+
],
|
|
344
|
+
[
|
|
345
|
+
1677376290000,
|
|
346
|
+
40091648
|
|
347
|
+
],
|
|
348
|
+
[
|
|
349
|
+
1677376305000,
|
|
350
|
+
40099840
|
|
351
|
+
],
|
|
352
|
+
[
|
|
353
|
+
1677376320000,
|
|
354
|
+
40120320
|
|
355
|
+
],
|
|
356
|
+
[
|
|
357
|
+
1677376335000,
|
|
358
|
+
40128512
|
|
359
|
+
],
|
|
360
|
+
[
|
|
361
|
+
1677376350000,
|
|
362
|
+
40153088
|
|
363
|
+
],
|
|
364
|
+
[
|
|
365
|
+
1677376365000,
|
|
366
|
+
40165376
|
|
367
|
+
],
|
|
368
|
+
[
|
|
369
|
+
1677376380000,
|
|
370
|
+
40177664
|
|
371
|
+
],
|
|
372
|
+
[
|
|
373
|
+
1677376395000,
|
|
374
|
+
40194048
|
|
375
|
+
],
|
|
376
|
+
[
|
|
377
|
+
1677376410000,
|
|
378
|
+
40198144
|
|
379
|
+
]
|
|
380
|
+
],
|
|
381
|
+
formattedName: 'node_memory_Buffers_bytes{env="demo",instance="demo.do.prometheus.io:9100",job="node"}',
|
|
382
|
+
labels: {
|
|
383
|
+
env: 'demo',
|
|
384
|
+
instance: 'demo.do.prometheus.io:9100',
|
|
385
|
+
job: 'node'
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
]
|
|
389
|
+
},
|
|
390
|
+
dataUpdatedAt: 1677376410000,
|
|
391
|
+
error: null,
|
|
392
|
+
errorUpdatedAt: 0,
|
|
393
|
+
failureCount: 0,
|
|
394
|
+
errorUpdateCount: 0,
|
|
395
|
+
isFetched: true,
|
|
396
|
+
isFetchedAfterMount: true,
|
|
397
|
+
isFetching: false,
|
|
398
|
+
isRefetching: false,
|
|
399
|
+
isLoadingError: false,
|
|
400
|
+
isPaused: false,
|
|
401
|
+
isPlaceholderData: false,
|
|
402
|
+
isPreviousData: false,
|
|
403
|
+
isRefetchError: false,
|
|
404
|
+
isStale: true
|
|
405
|
+
}
|
|
406
|
+
];
|
|
407
|
+
const MOCK_TIME_SERIES_QUERY_DEFINITION = {
|
|
408
|
+
kind: 'TimeSeriesQuery',
|
|
409
|
+
spec: {
|
|
410
|
+
plugin: {
|
|
411
|
+
kind: 'PrometheusTimeSeriesQuery',
|
|
412
|
+
spec: {
|
|
413
|
+
query: ''
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
};
|