@perses-dev/greptimedb-plugin 0.1.0 → 0.2.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/{GreptimeDB.d666b53a.js → GreptimeDB.f1e3a072.js} +4 -4
- package/__mf/js/async/121.caec175a.js +2 -0
- package/__mf/js/async/181.d4d87a1f.js +2 -0
- package/__mf/js/async/186.c1dea752.js +102 -0
- package/__mf/js/async/192.b9279059.js +1 -0
- package/__mf/js/async/2.dbc0a9c4.js +1 -0
- package/__mf/js/async/235.7a774edc.js +1 -0
- package/__mf/js/async/274.d5a294d9.js +2 -0
- package/__mf/js/async/356.21b667a3.js +1 -0
- package/__mf/js/async/392.201e515e.js +2 -0
- package/__mf/js/async/43.ebbb8652.js +2 -0
- package/__mf/js/async/440.f6c55d74.js +2 -0
- package/__mf/js/async/45.04388bc3.js +1 -0
- package/__mf/js/async/470.f896cf06.js +2 -0
- package/__mf/js/async/496.91780bef.js +1 -0
- package/__mf/js/async/529.6c76a9cd.js +43 -0
- package/__mf/js/async/{1589.a4d4fad9.js.LICENSE.txt → 529.6c76a9cd.js.LICENSE.txt} +41 -1
- package/__mf/js/async/562.15460f81.js +2 -0
- package/__mf/js/async/587.445bbdb5.js +1 -0
- package/__mf/js/async/588.2c301420.js +1 -0
- package/__mf/js/async/616.ef1089bf.js +1 -0
- package/__mf/js/async/628.6ea4a812.js +3 -0
- package/__mf/js/async/71.9f52cdd7.js +1 -0
- package/__mf/js/async/77.51ac6fa8.js +1 -0
- package/__mf/js/async/862.d29af04f.js +2 -0
- package/__mf/js/async/873.d5028ea7.js +1 -0
- package/__mf/js/async/941.6221d54d.js +2 -0
- package/__mf/js/async/944.89173f4a.js +10 -0
- package/__mf/js/async/968.6f0ebddf.js +1 -0
- package/__mf/js/async/978.4589faec.js +1 -0
- package/__mf/js/async/__federation_expose_GreptimeDBDatasource.ec9b176f.js +2 -0
- package/__mf/js/async/__federation_expose_GreptimeDBLogQuery.96bef921.js +21 -0
- package/__mf/js/async/__federation_expose_GreptimeDBTimeSeriesQuery.f4171877.js +21 -0
- package/__mf/js/async/__federation_expose_GreptimeDBTraceQuery.e0ffd686.js +21 -0
- package/__mf/js/{main.7dfdd439.js → main.993845fa.js} +3 -3
- package/lib/bootstrap.js +2 -2
- package/lib/components/GreptimeDBQLEditor.d.ts +2 -2
- package/lib/components/GreptimeDBQLEditor.d.ts.map +1 -1
- package/lib/components/GreptimeDBQLEditor.js +3 -3
- package/lib/components/GreptimeDBQLEditor.js.map +1 -1
- package/lib/components/index.js +2 -2
- package/lib/components/index.js.map +1 -1
- package/lib/datasources/greptimedb-datasource/GreptimeDBDatasource.d.ts +2 -2
- package/lib/datasources/greptimedb-datasource/GreptimeDBDatasource.d.ts.map +1 -1
- package/lib/datasources/greptimedb-datasource/GreptimeDBDatasource.js +4 -4
- package/lib/datasources/greptimedb-datasource/GreptimeDBDatasource.js.map +1 -1
- package/lib/datasources/greptimedb-datasource/GreptimeDBDatasourceEditor.d.ts +2 -2
- package/lib/datasources/greptimedb-datasource/GreptimeDBDatasourceEditor.d.ts.map +1 -1
- package/lib/datasources/greptimedb-datasource/GreptimeDBDatasourceEditor.js +1 -1
- package/lib/datasources/greptimedb-datasource/GreptimeDBDatasourceEditor.js.map +1 -1
- package/lib/datasources/greptimedb-datasource/greptimedb-datasource-types.d.ts +4 -4
- package/lib/datasources/greptimedb-datasource/greptimedb-datasource-types.d.ts.map +1 -1
- package/lib/datasources/greptimedb-datasource/greptimedb-datasource-types.js.map +1 -1
- package/lib/datasources/greptimedb-datasource/index.js +3 -3
- package/lib/datasources/greptimedb-datasource/index.js.map +1 -1
- package/lib/datasources/index.js +1 -1
- package/lib/datasources/index.js.map +1 -1
- 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 +3 -3
- package/lib/index.js.map +1 -1
- package/lib/model/greptimedb-client.d.ts +3 -3
- package/lib/model/greptimedb-client.d.ts.map +1 -1
- package/lib/model/greptimedb-client.js +4 -2
- package/lib/model/greptimedb-client.js.map +1 -1
- package/lib/queries/greptimedb-log-query/GreptimeDBLogQuery.d.ts +2 -2
- package/lib/queries/greptimedb-log-query/GreptimeDBLogQuery.d.ts.map +1 -1
- package/lib/queries/greptimedb-log-query/GreptimeDBLogQuery.js +4 -6
- package/lib/queries/greptimedb-log-query/GreptimeDBLogQuery.js.map +1 -1
- package/lib/queries/greptimedb-log-query/GreptimeDBLogQueryEditor.d.ts +3 -3
- package/lib/queries/greptimedb-log-query/GreptimeDBLogQueryEditor.d.ts.map +1 -1
- package/lib/queries/greptimedb-log-query/GreptimeDBLogQueryEditor.js +8 -8
- package/lib/queries/greptimedb-log-query/GreptimeDBLogQueryEditor.js.map +1 -1
- package/lib/queries/greptimedb-log-query/get-greptimedb-log-data.d.ts +2 -2
- package/lib/queries/greptimedb-log-query/get-greptimedb-log-data.d.ts.map +1 -1
- package/lib/queries/greptimedb-log-query/get-greptimedb-log-data.js +2 -2
- package/lib/queries/greptimedb-log-query/get-greptimedb-log-data.js.map +1 -1
- package/lib/queries/greptimedb-log-query/greptimedb-log-query-types.d.ts +1 -1
- package/lib/queries/greptimedb-log-query/greptimedb-log-query-types.d.ts.map +1 -1
- package/lib/queries/greptimedb-log-query/greptimedb-log-query-types.js.map +1 -1
- package/lib/queries/greptimedb-log-query/index.js +4 -4
- package/lib/queries/greptimedb-log-query/index.js.map +1 -1
- package/lib/queries/greptimedb-log-query/log-query-plugin-interface.d.ts +2 -2
- package/lib/queries/greptimedb-log-query/log-query-plugin-interface.d.ts.map +1 -1
- package/lib/queries/greptimedb-log-query/log-query-plugin-interface.js.map +1 -1
- package/lib/queries/greptimedb-query-data-model.d.ts +3 -3
- package/lib/queries/greptimedb-query-data-model.d.ts.map +1 -1
- package/lib/queries/greptimedb-query-data-model.js +4 -4
- package/lib/queries/greptimedb-query-data-model.js.map +1 -1
- package/lib/queries/greptimedb-time-series-query/GreptimeDBQuery.d.ts +2 -2
- package/lib/queries/greptimedb-time-series-query/GreptimeDBQuery.d.ts.map +1 -1
- package/lib/queries/greptimedb-time-series-query/GreptimeDBQuery.js +4 -6
- package/lib/queries/greptimedb-time-series-query/GreptimeDBQuery.js.map +1 -1
- package/lib/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.d.ts +3 -3
- package/lib/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.d.ts.map +1 -1
- package/lib/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.js +8 -8
- package/lib/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.js.map +1 -1
- package/lib/queries/greptimedb-time-series-query/get-greptimedb-data.d.ts +2 -2
- package/lib/queries/greptimedb-time-series-query/get-greptimedb-data.d.ts.map +1 -1
- package/lib/queries/greptimedb-time-series-query/get-greptimedb-data.js +3 -5
- package/lib/queries/greptimedb-time-series-query/get-greptimedb-data.js.map +1 -1
- package/lib/queries/greptimedb-time-series-query/greptimedb-query-types.d.ts +1 -1
- package/lib/queries/greptimedb-time-series-query/greptimedb-query-types.d.ts.map +1 -1
- package/lib/queries/greptimedb-time-series-query/greptimedb-query-types.js.map +1 -1
- package/lib/queries/greptimedb-time-series-query/index.js +4 -4
- package/lib/queries/greptimedb-time-series-query/index.js.map +1 -1
- package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQuery.d.ts +2 -2
- package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQuery.d.ts.map +1 -1
- package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQuery.js +3 -3
- package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQuery.js.map +1 -1
- package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.d.ts +3 -3
- package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.d.ts.map +1 -1
- package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.js +7 -7
- package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.js.map +1 -1
- package/lib/queries/greptimedb-trace-query/get-greptimedb-trace-data.d.ts +2 -2
- package/lib/queries/greptimedb-trace-query/get-greptimedb-trace-data.d.ts.map +1 -1
- package/lib/queries/greptimedb-trace-query/get-greptimedb-trace-data.js +6 -6
- package/lib/queries/greptimedb-trace-query/get-greptimedb-trace-data.js.map +1 -1
- package/lib/queries/greptimedb-trace-query/greptimedb-trace-query-types.d.ts +1 -1
- package/lib/queries/greptimedb-trace-query/greptimedb-trace-query-types.d.ts.map +1 -1
- package/lib/queries/greptimedb-trace-query/greptimedb-trace-query-types.js.map +1 -1
- package/lib/queries/greptimedb-trace-query/index.js +4 -4
- package/lib/queries/greptimedb-trace-query/index.js.map +1 -1
- package/lib/queries/index.js +3 -3
- package/lib/queries/index.js.map +1 -1
- package/lib/queries/query-editor-model.js +2 -2
- package/lib/queries/query-editor-model.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/mf-manifest.json +68 -100
- package/mf-stats.json +68 -104
- package/package.json +20 -12
- package/__mf/js/async/1589.a4d4fad9.js +0 -2
- package/__mf/js/async/1616.d071703e.js +0 -1
- package/__mf/js/async/2043.e37a8242.js +0 -2
- package/__mf/js/async/2386.84002e8c.js +0 -2
- package/__mf/js/async/3181.9e8e9ef5.js +0 -2
- package/__mf/js/async/392.614cab68.js +0 -2
- package/__mf/js/async/3944.f35af5a7.js +0 -10
- package/__mf/js/async/3981.66746f5c.js +0 -3
- package/__mf/js/async/4121.f8820bd7.js +0 -2
- package/__mf/js/async/4233.a3ff3ed2.js +0 -7
- package/__mf/js/async/4233.a3ff3ed2.js.LICENSE.txt +0 -39
- package/__mf/js/async/4475.52c68e1f.js +0 -101
- package/__mf/js/async/5002.ff5efed5.js +0 -1
- package/__mf/js/async/5071.72c3afda.js +0 -1
- package/__mf/js/async/5440.f8cb71c0.js +0 -2
- package/__mf/js/async/5481.0c2e941f.js +0 -2
- package/__mf/js/async/5562.fc9fccc9.js +0 -2
- package/__mf/js/async/5587.82a12128.js +0 -1
- package/__mf/js/async/6045.2b2dd0f6.js +0 -1
- package/__mf/js/async/6274.b682460a.js +0 -2
- package/__mf/js/async/629.e085c447.js +0 -1
- package/__mf/js/async/7177.746de250.js +0 -1
- package/__mf/js/async/7192.8effb0f3.js +0 -1
- package/__mf/js/async/7968.d3024d8d.js +0 -1
- package/__mf/js/async/7978.f72fcb59.js +0 -1
- package/__mf/js/async/7984.802dfa3c.js +0 -22
- package/__mf/js/async/7984.802dfa3c.js.LICENSE.txt +0 -19
- package/__mf/js/async/8356.42f66891.js +0 -1
- package/__mf/js/async/8470.8d2d3f35.js +0 -2
- package/__mf/js/async/873.9041549c.js +0 -1
- package/__mf/js/async/9235.8d75321e.js +0 -1
- package/__mf/js/async/941.6703c1a7.js +0 -2
- package/__mf/js/async/9558.97ad4633.js +0 -1
- package/__mf/js/async/9588.925f1ab4.js +0 -1
- package/__mf/js/async/9877.a7b7fb44.js +0 -38
- package/__mf/js/async/__federation_expose_GreptimeDBDatasource.7d12e7b8.js +0 -2
- package/__mf/js/async/__federation_expose_GreptimeDBLogQuery.f7fa9b26.js +0 -21
- package/__mf/js/async/__federation_expose_GreptimeDBTimeSeriesQuery.867c743e.js +0 -21
- package/__mf/js/async/__federation_expose_GreptimeDBTraceQuery.a1f7328d.js +0 -21
- package/__mf/js/async/__federation_expose_GreptimeDBTraceQuery.a1f7328d.js.LICENSE.txt +0 -9
- package/lib/cjs/bootstrap.js +0 -26
- package/lib/cjs/components/GreptimeDBQLEditor.js +0 -72
- package/lib/cjs/components/constants.js +0 -42
- package/lib/cjs/components/index.js +0 -31
- package/lib/cjs/datasources/greptimedb-datasource/GreptimeDBDatasource.js +0 -53
- package/lib/cjs/datasources/greptimedb-datasource/GreptimeDBDatasourceEditor.js +0 -51
- package/lib/cjs/datasources/greptimedb-datasource/greptimedb-datasource-types.js +0 -16
- package/lib/cjs/datasources/greptimedb-datasource/index.js +0 -32
- package/lib/cjs/datasources/index.js +0 -30
- package/lib/cjs/env.d.js +0 -14
- package/lib/cjs/getPluginModule.js +0 -39
- package/lib/cjs/index-federation.js +0 -55
- package/lib/cjs/index.js +0 -38
- package/lib/cjs/model/greptimedb-client.js +0 -76
- package/lib/cjs/model/greptimedb-data-types.js +0 -16
- package/lib/cjs/queries/constants.js +0 -34
- package/lib/cjs/queries/greptimedb-log-query/GreptimeDBLogQuery.js +0 -43
- package/lib/cjs/queries/greptimedb-log-query/GreptimeDBLogQueryEditor.js +0 -108
- package/lib/cjs/queries/greptimedb-log-query/get-greptimedb-log-data.js +0 -103
- package/lib/cjs/queries/greptimedb-log-query/greptimedb-log-query-types.js +0 -16
- package/lib/cjs/queries/greptimedb-log-query/index.js +0 -33
- package/lib/cjs/queries/greptimedb-log-query/log-query-plugin-interface.js +0 -16
- package/lib/cjs/queries/greptimedb-query-data-model.js +0 -152
- package/lib/cjs/queries/greptimedb-time-series-query/GreptimeDBQuery.js +0 -43
- package/lib/cjs/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.js +0 -107
- package/lib/cjs/queries/greptimedb-time-series-query/get-greptimedb-data.js +0 -184
- package/lib/cjs/queries/greptimedb-time-series-query/greptimedb-query-types.js +0 -16
- package/lib/cjs/queries/greptimedb-time-series-query/index.js +0 -33
- package/lib/cjs/queries/greptimedb-trace-query/GreptimeDBTraceQuery.js +0 -40
- package/lib/cjs/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.js +0 -79
- package/lib/cjs/queries/greptimedb-trace-query/get-greptimedb-trace-data.js +0 -518
- package/lib/cjs/queries/greptimedb-trace-query/greptimedb-trace-query-types.js +0 -16
- package/lib/cjs/queries/greptimedb-trace-query/index.js +0 -33
- package/lib/cjs/queries/greptimedb-trace-query/trace-query-sql.js +0 -25
- package/lib/cjs/queries/index.js +0 -32
- package/lib/cjs/queries/query-editor-model.js +0 -47
- package/lib/cjs/setup-tests.js +0 -19
- /package/__mf/css/async/{4233.85c2cbf6.css → 529.85c2cbf6.css} +0 -0
- /package/__mf/js/async/{4121.f8820bd7.js.LICENSE.txt → 121.caec175a.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{2386.84002e8c.js.LICENSE.txt → 181.d4d87a1f.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6274.b682460a.js.LICENSE.txt → 274.d5a294d9.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.614cab68.js.LICENSE.txt → 392.201e515e.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{2043.e37a8242.js.LICENSE.txt → 43.ebbb8652.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5440.f8cb71c0.js.LICENSE.txt → 440.f6c55d74.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{8470.8d2d3f35.js.LICENSE.txt → 470.f896cf06.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{3181.9e8e9ef5.js.LICENSE.txt → 562.15460f81.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5481.0c2e941f.js.LICENSE.txt → 862.d29af04f.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5562.fc9fccc9.js.LICENSE.txt → 941.6221d54d.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{3944.f35af5a7.js.LICENSE.txt → 944.89173f4a.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.6703c1a7.js.LICENSE.txt → __federation_expose_GreptimeDBDatasource.ec9b176f.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_GreptimeDBDatasource.7d12e7b8.js.LICENSE.txt → __federation_expose_GreptimeDBLogQuery.96bef921.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_GreptimeDBLogQuery.f7fa9b26.js.LICENSE.txt → __federation_expose_GreptimeDBTimeSeriesQuery.f4171877.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_GreptimeDBTimeSeriesQuery.867c743e.js.LICENSE.txt → __federation_expose_GreptimeDBTraceQuery.e0ffd686.js.LICENSE.txt} +0 -0
|
@@ -1,16 +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
|
-
});
|
|
@@ -1,33 +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
|
-
_export_star(require("./GreptimeDBLogQuery"), exports);
|
|
18
|
-
_export_star(require("./GreptimeDBLogQueryEditor"), exports);
|
|
19
|
-
_export_star(require("./get-greptimedb-log-data"), exports);
|
|
20
|
-
_export_star(require("./greptimedb-log-query-types"), exports);
|
|
21
|
-
function _export_star(from, to) {
|
|
22
|
-
Object.keys(from).forEach(function(k) {
|
|
23
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
24
|
-
Object.defineProperty(to, k, {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function() {
|
|
27
|
-
return from[k];
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
return from;
|
|
33
|
-
}
|
|
@@ -1,16 +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
|
-
});
|
|
@@ -1,152 +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 findTimeColumnIndex () {
|
|
25
|
-
return findTimeColumnIndex;
|
|
26
|
-
},
|
|
27
|
-
get normalizeRecords () {
|
|
28
|
-
return normalizeRecords;
|
|
29
|
-
},
|
|
30
|
-
get replaceQueryVariables () {
|
|
31
|
-
return replaceQueryVariables;
|
|
32
|
-
},
|
|
33
|
-
get toTimestampMs () {
|
|
34
|
-
return toTimestampMs;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
38
|
-
function replaceQueryVariables(query, variableState, timeRange) {
|
|
39
|
-
const { start, end } = timeRange;
|
|
40
|
-
const rangeMs = end.valueOf() - start.valueOf();
|
|
41
|
-
const builtinState = {
|
|
42
|
-
__from: {
|
|
43
|
-
value: start.valueOf().toString(),
|
|
44
|
-
loading: false
|
|
45
|
-
},
|
|
46
|
-
__to: {
|
|
47
|
-
value: end.valueOf().toString(),
|
|
48
|
-
loading: false
|
|
49
|
-
},
|
|
50
|
-
__range_ms: {
|
|
51
|
-
value: rangeMs.toString(),
|
|
52
|
-
loading: false
|
|
53
|
-
},
|
|
54
|
-
__range_s: {
|
|
55
|
-
value: Math.floor(rangeMs / 1000).toString(),
|
|
56
|
-
loading: false
|
|
57
|
-
},
|
|
58
|
-
__range: {
|
|
59
|
-
value: formatDuration(rangeMs),
|
|
60
|
-
loading: false
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
// User-defined variables take precedence over builtins (matching framework behaviour).
|
|
64
|
-
return (0, _pluginsystem.replaceVariables)(query, {
|
|
65
|
-
...builtinState,
|
|
66
|
-
...variableState
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
/** Format a millisecond duration as a human-readable Prometheus-style string, e.g. "1h5m30s". */ function formatDuration(ms) {
|
|
70
|
-
const totalSeconds = Math.floor(ms / 1000);
|
|
71
|
-
const hours = Math.floor(totalSeconds / 3600);
|
|
72
|
-
const minutes = Math.floor(totalSeconds % 3600 / 60);
|
|
73
|
-
const seconds = totalSeconds % 60;
|
|
74
|
-
let result = '';
|
|
75
|
-
if (hours > 0) result += `${hours}h`;
|
|
76
|
-
if (minutes > 0) result += `${minutes}m`;
|
|
77
|
-
if (seconds > 0 || result === '') result += `${seconds}s`;
|
|
78
|
-
return result;
|
|
79
|
-
}
|
|
80
|
-
function normalizeTimestampType(dataType) {
|
|
81
|
-
if (!dataType) {
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
return dataType.toLowerCase();
|
|
85
|
-
}
|
|
86
|
-
function toTimestampMs(value, dataType) {
|
|
87
|
-
if (value === null || value === undefined) {
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
const normalizedType = normalizeTimestampType(dataType);
|
|
91
|
-
if (typeof value === 'number') {
|
|
92
|
-
if (normalizedType) {
|
|
93
|
-
if (normalizedType.includes('nanosecond')) {
|
|
94
|
-
return Math.floor(value / 1_000_000);
|
|
95
|
-
}
|
|
96
|
-
if (normalizedType.includes('microsecond')) {
|
|
97
|
-
return Math.floor(value / 1_000);
|
|
98
|
-
}
|
|
99
|
-
if (normalizedType.includes('millisecond')) {
|
|
100
|
-
return value;
|
|
101
|
-
}
|
|
102
|
-
if (normalizedType.includes('second')) {
|
|
103
|
-
return value * 1000;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
if (value > 1_000_000_000_000_000) {
|
|
107
|
-
return Math.floor(value / 1_000_000);
|
|
108
|
-
}
|
|
109
|
-
if (value > 1_000_000_000_000) {
|
|
110
|
-
return value;
|
|
111
|
-
}
|
|
112
|
-
if (value > 1_000_000_000) {
|
|
113
|
-
return value * 1000;
|
|
114
|
-
}
|
|
115
|
-
return value;
|
|
116
|
-
}
|
|
117
|
-
if (typeof value === 'string') {
|
|
118
|
-
const asNumber = Number(value);
|
|
119
|
-
if (!Number.isNaN(asNumber)) {
|
|
120
|
-
return toTimestampMs(asNumber, dataType);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
const asDate = new Date(value);
|
|
124
|
-
const ts = asDate.getTime();
|
|
125
|
-
return Number.isNaN(ts) ? null : ts;
|
|
126
|
-
}
|
|
127
|
-
function normalizeRecords(payload) {
|
|
128
|
-
if (!payload || typeof payload !== 'object') return undefined;
|
|
129
|
-
return payload.output?.[0]?.records;
|
|
130
|
-
}
|
|
131
|
-
function findTimeColumnIndex(columnSchemas) {
|
|
132
|
-
let timeIndex = -1;
|
|
133
|
-
const timestampColumns = columnSchemas.filter((col)=>{
|
|
134
|
-
const normalizedType = normalizeTimestampType(col.data_type);
|
|
135
|
-
return normalizedType !== null && normalizedType.startsWith('timestamp');
|
|
136
|
-
});
|
|
137
|
-
if (timestampColumns.length > 0) {
|
|
138
|
-
const semanticTimestamp = timestampColumns.find((col)=>col.semantic_type?.toLowerCase() === 'timestamp');
|
|
139
|
-
const selectedColumn = semanticTimestamp ?? timestampColumns[0];
|
|
140
|
-
timeIndex = columnSchemas.findIndex((col)=>col.name === selectedColumn.name);
|
|
141
|
-
}
|
|
142
|
-
if (timeIndex === -1) {
|
|
143
|
-
const fallbackColumns = [
|
|
144
|
-
'greptime_timestamp',
|
|
145
|
-
'timestamp',
|
|
146
|
-
'ts',
|
|
147
|
-
'time'
|
|
148
|
-
];
|
|
149
|
-
timeIndex = columnSchemas.findIndex((col)=>fallbackColumns.includes(col.name.toLowerCase()));
|
|
150
|
-
}
|
|
151
|
-
return timeIndex;
|
|
152
|
-
}
|
|
@@ -1,43 +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, "GreptimeDBTimeSeriesQuery", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return GreptimeDBTimeSeriesQuery;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
24
|
-
const _getgreptimedbdata = require("./get-greptimedb-data");
|
|
25
|
-
const _GreptimeDBQueryEditor = require("./GreptimeDBQueryEditor");
|
|
26
|
-
const GreptimeDBTimeSeriesQuery = {
|
|
27
|
-
getTimeSeriesData: _getgreptimedbdata.getTimeSeriesData,
|
|
28
|
-
OptionsEditorComponent: _GreptimeDBQueryEditor.GreptimeDBTimeSeriesQueryEditor,
|
|
29
|
-
createInitialOptions: ()=>({
|
|
30
|
-
query: ''
|
|
31
|
-
}),
|
|
32
|
-
dependsOn: (spec)=>{
|
|
33
|
-
const queryVariables = (0, _pluginsystem.parseVariables)(spec.query);
|
|
34
|
-
const allVariables = [
|
|
35
|
-
...new Set([
|
|
36
|
-
...queryVariables
|
|
37
|
-
])
|
|
38
|
-
];
|
|
39
|
-
return {
|
|
40
|
-
variables: allVariables
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
};
|
|
@@ -1,107 +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, "GreptimeDBTimeSeriesQueryEditor", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return GreptimeDBTimeSeriesQueryEditor;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
25
|
-
const _react = require("react");
|
|
26
|
-
const _immer = require("immer");
|
|
27
|
-
const _material = require("@mui/material");
|
|
28
|
-
const _constants = require("../constants");
|
|
29
|
-
const _components = require("../../components");
|
|
30
|
-
const _constants1 = require("../../components/constants");
|
|
31
|
-
const _queryeditormodel = require("../query-editor-model");
|
|
32
|
-
function GreptimeDBTimeSeriesQueryEditor(props) {
|
|
33
|
-
const { onChange, value } = props;
|
|
34
|
-
const { datasource } = value;
|
|
35
|
-
const selectedDatasource = datasource ?? _constants.DEFAULT_DATASOURCE;
|
|
36
|
-
const { query, handleQueryChange, handleQueryBlur } = (0, _queryeditormodel.useQueryState)(props);
|
|
37
|
-
const handleDatasourceChange = (newDatasourceSelection)=>{
|
|
38
|
-
if (!(0, _pluginsystem.isVariableDatasource)(newDatasourceSelection) && newDatasourceSelection.kind === _constants.DATASOURCE_KIND) {
|
|
39
|
-
onChange((0, _immer.produce)(value, (draft)=>{
|
|
40
|
-
draft.datasource = newDatasourceSelection;
|
|
41
|
-
}));
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
throw new Error('Got unexpected non GreptimeDB datasource selection');
|
|
45
|
-
};
|
|
46
|
-
const handleQueryExecute = (queryValue)=>{
|
|
47
|
-
onChange((0, _immer.produce)(value, (draft)=>{
|
|
48
|
-
draft.query = queryValue;
|
|
49
|
-
}));
|
|
50
|
-
};
|
|
51
|
-
const handleGreptimeDBQueryChange = (0, _react.useCallback)((e)=>{
|
|
52
|
-
handleQueryChange(e);
|
|
53
|
-
}, [
|
|
54
|
-
handleQueryChange
|
|
55
|
-
]);
|
|
56
|
-
const examplesStyle = {
|
|
57
|
-
fontSize: '11px',
|
|
58
|
-
color: '#777',
|
|
59
|
-
backgroundColor: '#f5f5f5',
|
|
60
|
-
padding: '8px',
|
|
61
|
-
borderRadius: '4px',
|
|
62
|
-
fontFamily: 'Monaco, Menlo, "Ubuntu Mono", monospace',
|
|
63
|
-
whiteSpace: 'pre-wrap',
|
|
64
|
-
lineHeight: '1.3'
|
|
65
|
-
};
|
|
66
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
67
|
-
spacing: 1.5,
|
|
68
|
-
children: [
|
|
69
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DatasourceSelect, {
|
|
70
|
-
datasourcePluginKind: _constants.DATASOURCE_KIND,
|
|
71
|
-
value: selectedDatasource,
|
|
72
|
-
onChange: handleDatasourceChange,
|
|
73
|
-
label: "GreptimeDB Datasource",
|
|
74
|
-
notched: true
|
|
75
|
-
}),
|
|
76
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.GreptimeDBQLEditor, {
|
|
77
|
-
value: query,
|
|
78
|
-
onChange: handleGreptimeDBQueryChange,
|
|
79
|
-
onBlur: handleQueryBlur,
|
|
80
|
-
onKeyDown: (event)=>{
|
|
81
|
-
if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {
|
|
82
|
-
event.preventDefault();
|
|
83
|
-
handleQueryExecute(query);
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
placeholder: "Enter GreptimeDB SQL query"
|
|
87
|
-
}),
|
|
88
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)("details", {
|
|
89
|
-
children: [
|
|
90
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("summary", {
|
|
91
|
-
style: {
|
|
92
|
-
cursor: 'pointer',
|
|
93
|
-
fontSize: '12px',
|
|
94
|
-
color: '#666',
|
|
95
|
-
marginBottom: '8px'
|
|
96
|
-
},
|
|
97
|
-
children: "Query Examples"
|
|
98
|
-
}),
|
|
99
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
100
|
-
style: examplesStyle,
|
|
101
|
-
children: _constants1.queryExample
|
|
102
|
-
})
|
|
103
|
-
]
|
|
104
|
-
})
|
|
105
|
-
]
|
|
106
|
-
});
|
|
107
|
-
}
|
|
@@ -1,184 +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, "getTimeSeriesData", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return getTimeSeriesData;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _constants = require("../constants");
|
|
24
|
-
const _greptimedbquerydatamodel = require("../greptimedb-query-data-model");
|
|
25
|
-
function isLikelyNumericType(dataType) {
|
|
26
|
-
if (!dataType) return false;
|
|
27
|
-
const t = dataType.toLowerCase();
|
|
28
|
-
return t.includes('int') || t.includes('float') || t.includes('double') || t.includes('decimal') || t.includes('number');
|
|
29
|
-
}
|
|
30
|
-
function buildSeriesName(valueColumnName, labels) {
|
|
31
|
-
const entries = Object.entries(labels);
|
|
32
|
-
if (entries.length === 0) {
|
|
33
|
-
return valueColumnName;
|
|
34
|
-
}
|
|
35
|
-
return entries.map(([k, v])=>`${k}=${v}`).join(',');
|
|
36
|
-
}
|
|
37
|
-
function buildTimeSeries(records, fallbackTimestampMs) {
|
|
38
|
-
const columnSchemas = records?.schema?.column_schemas ?? [];
|
|
39
|
-
const rows = records?.rows ?? [];
|
|
40
|
-
if (!columnSchemas.length || !rows.length) {
|
|
41
|
-
return [];
|
|
42
|
-
}
|
|
43
|
-
const timeIndex = (0, _greptimedbquerydatamodel.findTimeColumnIndex)(columnSchemas);
|
|
44
|
-
if (timeIndex === -1) {
|
|
45
|
-
// Stat-style queries (e.g. `select count(*)`) may return a single numeric column with no timestamp.
|
|
46
|
-
// In this case, emit a synthetic single-point series to keep numeric panels working.
|
|
47
|
-
const scalarValueIndex = columnSchemas.findIndex((c)=>isLikelyNumericType(c.data_type));
|
|
48
|
-
if (scalarValueIndex === -1) {
|
|
49
|
-
return [];
|
|
50
|
-
}
|
|
51
|
-
const scalarColumnName = columnSchemas[scalarValueIndex]?.name ?? 'value';
|
|
52
|
-
const scalarValues = [];
|
|
53
|
-
rows.forEach((row, rowIndex)=>{
|
|
54
|
-
const raw = row?.[scalarValueIndex];
|
|
55
|
-
const value = typeof raw === 'number' ? raw : Number(raw);
|
|
56
|
-
if (!Number.isFinite(value)) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
// Spread multiple rows by 1ms so ordering is stable.
|
|
60
|
-
scalarValues.push([
|
|
61
|
-
fallbackTimestampMs + rowIndex,
|
|
62
|
-
value
|
|
63
|
-
]);
|
|
64
|
-
});
|
|
65
|
-
if (scalarValues.length === 0) {
|
|
66
|
-
return [];
|
|
67
|
-
}
|
|
68
|
-
return [
|
|
69
|
-
{
|
|
70
|
-
name: scalarColumnName,
|
|
71
|
-
labels: {},
|
|
72
|
-
values: scalarValues
|
|
73
|
-
}
|
|
74
|
-
];
|
|
75
|
-
}
|
|
76
|
-
// Choose a "value" column. Prefer greptime conventions, then fall back to the first numeric column.
|
|
77
|
-
let valueIndex = columnSchemas.findIndex((c, idx)=>idx !== timeIndex && c.name.toLowerCase() === 'greptime_value');
|
|
78
|
-
if (valueIndex === -1) {
|
|
79
|
-
valueIndex = columnSchemas.findIndex((c, idx)=>idx !== timeIndex && c.name.toLowerCase() === 'value');
|
|
80
|
-
}
|
|
81
|
-
if (valueIndex === -1) {
|
|
82
|
-
valueIndex = columnSchemas.findIndex((c, idx)=>idx !== timeIndex && isLikelyNumericType(c.data_type));
|
|
83
|
-
}
|
|
84
|
-
if (valueIndex === -1) {
|
|
85
|
-
// Last resort: treat the first non-time column as value.
|
|
86
|
-
valueIndex = columnSchemas.findIndex((_, idx)=>idx !== timeIndex);
|
|
87
|
-
}
|
|
88
|
-
const valueColumnName = columnSchemas[valueIndex]?.name ?? 'value';
|
|
89
|
-
// Chart-safe default: group rows into standard timeseries (multiple points per series).
|
|
90
|
-
const seriesMap = new Map();
|
|
91
|
-
for (const row of rows){
|
|
92
|
-
const tsMs = (0, _greptimedbquerydatamodel.toTimestampMs)(row?.[timeIndex], columnSchemas[timeIndex]?.data_type);
|
|
93
|
-
if (tsMs === null) {
|
|
94
|
-
continue;
|
|
95
|
-
}
|
|
96
|
-
const raw = row?.[valueIndex];
|
|
97
|
-
const value = typeof raw === 'number' ? raw : Number(raw);
|
|
98
|
-
if (!Number.isFinite(value)) {
|
|
99
|
-
continue;
|
|
100
|
-
}
|
|
101
|
-
const labels = {};
|
|
102
|
-
columnSchemas.forEach((col, idx)=>{
|
|
103
|
-
if (idx === timeIndex || idx === valueIndex) return;
|
|
104
|
-
const v = row?.[idx];
|
|
105
|
-
labels[col.name] = v === null || v === undefined ? '' : String(v);
|
|
106
|
-
});
|
|
107
|
-
// Stable series key by label set.
|
|
108
|
-
const labelsKey = columnSchemas.filter((_, idx)=>idx !== timeIndex && idx !== valueIndex).map((c)=>`${c.name}=${labels[c.name] ?? ''}`).join('|');
|
|
109
|
-
const key = `${valueColumnName}|${labelsKey}`;
|
|
110
|
-
const existing = seriesMap.get(key);
|
|
111
|
-
if (existing) {
|
|
112
|
-
existing.values.push([
|
|
113
|
-
tsMs,
|
|
114
|
-
value
|
|
115
|
-
]);
|
|
116
|
-
} else {
|
|
117
|
-
seriesMap.set(key, {
|
|
118
|
-
name: buildSeriesName(valueColumnName, labels),
|
|
119
|
-
labels,
|
|
120
|
-
values: [
|
|
121
|
-
[
|
|
122
|
-
tsMs,
|
|
123
|
-
value
|
|
124
|
-
]
|
|
125
|
-
]
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
return Array.from(seriesMap.values()).filter((s)=>s.values.length > 0);
|
|
130
|
-
}
|
|
131
|
-
function inferStepMsFromSeries(series, fallbackStepMs) {
|
|
132
|
-
let minDeltaMs = Number.POSITIVE_INFINITY;
|
|
133
|
-
for (const s of series){
|
|
134
|
-
const sortedTimestamps = [
|
|
135
|
-
...s.values.map(([ts])=>ts)
|
|
136
|
-
].sort((a, b)=>a - b);
|
|
137
|
-
for(let i = 1; i < sortedTimestamps.length; i++){
|
|
138
|
-
const delta = sortedTimestamps[i] - sortedTimestamps[i - 1];
|
|
139
|
-
if (delta > 0 && delta < minDeltaMs) {
|
|
140
|
-
minDeltaMs = delta;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
return Number.isFinite(minDeltaMs) ? minDeltaMs : fallbackStepMs;
|
|
145
|
-
}
|
|
146
|
-
const getTimeSeriesData = async (spec, context)=>{
|
|
147
|
-
if (!spec.query) {
|
|
148
|
-
return {
|
|
149
|
-
series: []
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
const { start, end } = context.timeRange;
|
|
153
|
-
const query = (0, _greptimedbquerydatamodel.replaceQueryVariables)(spec.query, context.variableState, context.timeRange);
|
|
154
|
-
const client = await context.datasourceStore.getDatasourceClient(spec.datasource ?? _constants.DEFAULT_DATASOURCE);
|
|
155
|
-
const response = await client.query({
|
|
156
|
-
start: start.getTime().toString(),
|
|
157
|
-
end: end.getTime().toString(),
|
|
158
|
-
query
|
|
159
|
-
});
|
|
160
|
-
if (response.status === 'error') {
|
|
161
|
-
throw new Error(response.error ?? 'GreptimeDB query failed');
|
|
162
|
-
}
|
|
163
|
-
const records = (0, _greptimedbquerydatamodel.normalizeRecords)(response.data);
|
|
164
|
-
const tableColumns = records?.schema?.column_schemas ?? [];
|
|
165
|
-
const tableRows = records?.rows ?? [];
|
|
166
|
-
const series = buildTimeSeries(records, end.getTime());
|
|
167
|
-
const stepMs = inferStepMsFromSeries(series, context.suggestedStepMs || 30 * 1000);
|
|
168
|
-
return {
|
|
169
|
-
series,
|
|
170
|
-
timeRange: {
|
|
171
|
-
start,
|
|
172
|
-
end
|
|
173
|
-
},
|
|
174
|
-
stepMs,
|
|
175
|
-
metadata: {
|
|
176
|
-
executedQueryString: query,
|
|
177
|
-
records,
|
|
178
|
-
table: {
|
|
179
|
-
columns: tableColumns,
|
|
180
|
-
rows: tableRows
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
};
|
|
@@ -1,16 +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
|
-
});
|
|
@@ -1,33 +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
|
-
_export_star(require("./get-greptimedb-data"), exports);
|
|
18
|
-
_export_star(require("./GreptimeDBQuery"), exports);
|
|
19
|
-
_export_star(require("./GreptimeDBQueryEditor"), exports);
|
|
20
|
-
_export_star(require("./greptimedb-query-types"), exports);
|
|
21
|
-
function _export_star(from, to) {
|
|
22
|
-
Object.keys(from).forEach(function(k) {
|
|
23
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
24
|
-
Object.defineProperty(to, k, {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function() {
|
|
27
|
-
return from[k];
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
return from;
|
|
33
|
-
}
|
|
@@ -1,40 +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, "GreptimeDBTraceQuery", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return GreptimeDBTraceQuery;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
24
|
-
const _getgreptimedbtracedata = require("./get-greptimedb-trace-data");
|
|
25
|
-
const _GreptimeDBTraceQueryEditor = require("./GreptimeDBTraceQueryEditor");
|
|
26
|
-
const GreptimeDBTraceQuery = {
|
|
27
|
-
getTraceData: _getgreptimedbtracedata.getGreptimeDBTraceData,
|
|
28
|
-
OptionsEditorComponent: _GreptimeDBTraceQueryEditor.GreptimeDBTraceQueryEditor,
|
|
29
|
-
createInitialOptions: ()=>({
|
|
30
|
-
query: ''
|
|
31
|
-
}),
|
|
32
|
-
dependsOn: (spec)=>{
|
|
33
|
-
const queryVariables = (0, _pluginsystem.parseVariables)(spec.query);
|
|
34
|
-
return {
|
|
35
|
-
variables: [
|
|
36
|
-
...new Set(queryVariables)
|
|
37
|
-
]
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
};
|