@perses-dev/core 0.0.0-snapshot-profile-89b306f → 0.0.0-snapshot-panel-actions-520389b
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/model/index.js +0 -1
- package/dist/cjs/model/panels.js +18 -0
- package/dist/cjs/model/query.js +1 -2
- package/dist/cjs/utils/time-series-data.js +0 -35
- package/dist/model/index.d.ts +0 -1
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +0 -1
- package/dist/model/index.js.map +1 -1
- package/dist/model/panels.d.ts +32 -0
- package/dist/model/panels.d.ts.map +1 -1
- package/dist/model/panels.js +12 -3
- package/dist/model/panels.js.map +1 -1
- package/dist/model/query.d.ts +0 -2
- package/dist/model/query.d.ts.map +1 -1
- package/dist/model/query.js +1 -2
- package/dist/model/query.js.map +1 -1
- package/dist/utils/time-series-data.d.ts +0 -12
- package/dist/utils/time-series-data.d.ts.map +1 -1
- package/dist/utils/time-series-data.js +0 -37
- package/dist/utils/time-series-data.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/model/profile-data.js +0 -20
- package/dist/model/profile-data.d.ts +0 -49
- package/dist/model/profile-data.d.ts.map +0 -1
- package/dist/model/profile-data.js +0 -19
- package/dist/model/profile-data.js.map +0 -1
package/dist/cjs/model/index.js
CHANGED
|
@@ -39,7 +39,6 @@ _export_star(require("./time"), exports);
|
|
|
39
39
|
_export_star(require("./time-series-data"), exports);
|
|
40
40
|
_export_star(require("./time-series-queries"), exports);
|
|
41
41
|
_export_star(require("./trace-data"), exports);
|
|
42
|
-
_export_star(require("./profile-data"), exports);
|
|
43
42
|
_export_star(require("./transforms"), exports);
|
|
44
43
|
_export_star(require("./units"), exports);
|
|
45
44
|
_export_star(require("./user"), exports);
|
package/dist/cjs/model/panels.js
CHANGED
|
@@ -14,3 +14,21 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
+
Object.defineProperty(exports, "EXPORT_FORMATS", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return EXPORT_FORMATS;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const EXPORT_FORMATS = {
|
|
24
|
+
CSV: {
|
|
25
|
+
name: 'CSV',
|
|
26
|
+
extension: 'csv',
|
|
27
|
+
mimeType: 'text/csv'
|
|
28
|
+
},
|
|
29
|
+
JSON: {
|
|
30
|
+
name: 'JSON',
|
|
31
|
+
extension: 'json',
|
|
32
|
+
mimeType: 'application/json'
|
|
33
|
+
}
|
|
34
|
+
};
|
package/dist/cjs/model/query.js
CHANGED
|
@@ -29,25 +29,10 @@ _export(exports, {
|
|
|
29
29
|
},
|
|
30
30
|
getTimeSeriesValues: function() {
|
|
31
31
|
return getTimeSeriesValues;
|
|
32
|
-
},
|
|
33
|
-
getXValues: function() {
|
|
34
|
-
return getXValues;
|
|
35
|
-
},
|
|
36
|
-
getYValues: function() {
|
|
37
|
-
return getYValues;
|
|
38
32
|
}
|
|
39
33
|
});
|
|
40
34
|
const _mathjs = require("./mathjs");
|
|
41
35
|
const MIN_STEP_INTERVAL_MS = 10;
|
|
42
|
-
function getXValues(timeScale) {
|
|
43
|
-
const xValues = [];
|
|
44
|
-
let timestamp = timeScale.startMs;
|
|
45
|
-
while(timestamp <= timeScale.endMs){
|
|
46
|
-
xValues.push(timestamp);
|
|
47
|
-
timestamp += timeScale.stepMs;
|
|
48
|
-
}
|
|
49
|
-
return xValues;
|
|
50
|
-
}
|
|
51
36
|
function getTimeSeriesValues(series, timeScale) {
|
|
52
37
|
let timestamp = timeScale.startMs;
|
|
53
38
|
const values = series.values;
|
|
@@ -78,26 +63,6 @@ function getTimeSeriesValues(series, timeScale) {
|
|
|
78
63
|
}
|
|
79
64
|
return processedValues;
|
|
80
65
|
}
|
|
81
|
-
function getYValues(series, timeScale) {
|
|
82
|
-
let timestamp = timeScale.startMs;
|
|
83
|
-
const yValues = [];
|
|
84
|
-
for (const valueTuple of series.values){
|
|
85
|
-
// Fill in values up to the current series value timestamp with nulls
|
|
86
|
-
while(timestamp < valueTuple[0]){
|
|
87
|
-
yValues.push(null);
|
|
88
|
-
timestamp += timeScale.stepMs;
|
|
89
|
-
}
|
|
90
|
-
// Now add the current value since timestamp should match
|
|
91
|
-
yValues.push(valueTuple[1]);
|
|
92
|
-
timestamp += timeScale.stepMs;
|
|
93
|
-
}
|
|
94
|
-
// Add null values at the end of the series if necessary
|
|
95
|
-
while(timestamp <= timeScale.endMs){
|
|
96
|
-
yValues.push(null);
|
|
97
|
-
timestamp += timeScale.stepMs;
|
|
98
|
-
}
|
|
99
|
-
return yValues;
|
|
100
|
-
}
|
|
101
66
|
function getCommonTimeScale(seriesData) {
|
|
102
67
|
let timeRange = undefined;
|
|
103
68
|
const steps = [];
|
package/dist/model/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAaA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAaA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
|
package/dist/model/index.js
CHANGED
package/dist/model/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './calculations';\nexport * from './dashboard';\nexport * from './datasource';\nexport * from './definitions';\nexport * from './display';\nexport * from './ephemeraldashboard';\nexport * from './http';\nexport * from './http-proxy';\nexport * from './kind';\nexport * from './layout';\nexport * from './legend';\nexport * from './notice';\nexport * from './otlp';\nexport * from './panels';\nexport * from './project';\nexport * from './query';\nexport * from './resource';\nexport * from './roles';\nexport * from './rolebindings';\nexport * from './secrets';\nexport * from './thresholds';\nexport * from './time';\nexport * from './time-series-data';\nexport * from './time-series-queries';\nexport * from './trace-data';\nexport * from './
|
|
1
|
+
{"version":3,"sources":["../../src/model/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './calculations';\nexport * from './dashboard';\nexport * from './datasource';\nexport * from './definitions';\nexport * from './display';\nexport * from './ephemeraldashboard';\nexport * from './http';\nexport * from './http-proxy';\nexport * from './kind';\nexport * from './layout';\nexport * from './legend';\nexport * from './notice';\nexport * from './otlp';\nexport * from './panels';\nexport * from './project';\nexport * from './query';\nexport * from './resource';\nexport * from './roles';\nexport * from './rolebindings';\nexport * from './secrets';\nexport * from './thresholds';\nexport * from './time';\nexport * from './time-series-data';\nexport * from './time-series-queries';\nexport * from './trace-data';\nexport * from './transforms';\nexport * from './units';\nexport * from './user';\nexport * from './variables';\nexport * from './value-mapping';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,iBAAiB;AAC/B,cAAc,cAAc;AAC5B,cAAc,eAAe;AAC7B,cAAc,gBAAgB;AAC9B,cAAc,YAAY;AAC1B,cAAc,uBAAuB;AACrC,cAAc,SAAS;AACvB,cAAc,eAAe;AAC7B,cAAc,SAAS;AACvB,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,SAAS;AACvB,cAAc,WAAW;AACzB,cAAc,YAAY;AAC1B,cAAc,UAAU;AACxB,cAAc,aAAa;AAC3B,cAAc,UAAU;AACxB,cAAc,iBAAiB;AAC/B,cAAc,YAAY;AAC1B,cAAc,eAAe;AAC7B,cAAc,SAAS;AACvB,cAAc,qBAAqB;AACnC,cAAc,wBAAwB;AACtC,cAAc,eAAe;AAC7B,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,SAAS;AACvB,cAAc,cAAc;AAC5B,cAAc,kBAAkB"}
|
package/dist/model/panels.d.ts
CHANGED
|
@@ -34,4 +34,36 @@ export interface PanelEditorValues {
|
|
|
34
34
|
groupId: PanelGroupId;
|
|
35
35
|
panelDefinition: PanelDefinition;
|
|
36
36
|
}
|
|
37
|
+
export interface ExportFormat {
|
|
38
|
+
name: string;
|
|
39
|
+
extension: string;
|
|
40
|
+
mimeType: string;
|
|
41
|
+
}
|
|
42
|
+
export interface ExportData {
|
|
43
|
+
format: ExportFormat;
|
|
44
|
+
data: Blob;
|
|
45
|
+
filename: string;
|
|
46
|
+
}
|
|
47
|
+
export interface DataExportCapability {
|
|
48
|
+
getSupportedFormats(): ExportFormat[];
|
|
49
|
+
exportData(format: ExportFormat, options?: ExportOptions): Promise<ExportData>;
|
|
50
|
+
}
|
|
51
|
+
export interface ExportOptions {
|
|
52
|
+
title?: string;
|
|
53
|
+
projectName?: string;
|
|
54
|
+
customFilename?: string;
|
|
55
|
+
includeMetadata?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export declare const EXPORT_FORMATS: {
|
|
58
|
+
readonly CSV: {
|
|
59
|
+
readonly name: "CSV";
|
|
60
|
+
readonly extension: "csv";
|
|
61
|
+
readonly mimeType: "text/csv";
|
|
62
|
+
};
|
|
63
|
+
readonly JSON: {
|
|
64
|
+
readonly name: "JSON";
|
|
65
|
+
readonly extension: "json";
|
|
66
|
+
readonly mimeType: "application/json";
|
|
67
|
+
};
|
|
68
|
+
};
|
|
37
69
|
//# sourceMappingURL=panels.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panels.d.ts","sourceRoot":"","sources":["../../src/model/panels.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,WAAW,IAAI;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe,CAAC,UAAU,GAAG,WAAW,CAAE,SAAQ,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAClG,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,SAAS,CAAC,UAAU,GAAG,WAAW;IACjD,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,QA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AY,CAAC;IACtB,eAAe,EAAE,eAAe,CAAC;CAClC;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,YAAY,CAAC;IACrB,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,mBAAmB,IAAI,YAAY,EAAE,CAAC;IACtC,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CAChF;AACD,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;CAGjB,CAAC"}
|
package/dist/model/panels.js
CHANGED
|
@@ -10,8 +10,17 @@
|
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
export const EXPORT_FORMATS = {
|
|
14
|
+
CSV: {
|
|
15
|
+
name: 'CSV',
|
|
16
|
+
extension: 'csv',
|
|
17
|
+
mimeType: 'text/csv'
|
|
18
|
+
},
|
|
19
|
+
JSON: {
|
|
20
|
+
name: 'JSON',
|
|
21
|
+
extension: 'json',
|
|
22
|
+
mimeType: 'application/json'
|
|
23
|
+
}
|
|
24
|
+
};
|
|
16
25
|
|
|
17
26
|
//# sourceMappingURL=panels.js.map
|
package/dist/model/panels.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/panels.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Definition, UnknownSpec } from './definitions';\nimport { QueryDefinition } from './query';\n\nexport interface Link {\n name?: string;\n url: string;\n tooltip?: string;\n renderVariables?: boolean;\n targetBlank?: boolean;\n}\n\nexport interface PanelDisplay {\n name: string;\n description?: string;\n}\n\nexport interface PanelDefinition<PluginSpec = UnknownSpec> extends Definition<PanelSpec<PluginSpec>> {\n kind: 'Panel';\n}\n\nexport interface PanelSpec<PluginSpec = UnknownSpec> {\n display: PanelDisplay;\n plugin: Definition<PluginSpec>;\n queries?: QueryDefinition[];\n links?: Link[];\n}\n\n/**\n * A reference to a panel defined in the DashboardSpec.\n */\nexport interface PanelRef {\n $ref: `#/spec/panels/${string}`;\n}\n\nexport type PanelGroupId = number;\n\n/**\n * Panel values that can be edited in the panel editor.\n */\nexport interface PanelEditorValues {\n groupId: PanelGroupId;\n panelDefinition: PanelDefinition;\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;
|
|
1
|
+
{"version":3,"sources":["../../src/model/panels.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Definition, UnknownSpec } from './definitions';\nimport { QueryDefinition } from './query';\n\nexport interface Link {\n name?: string;\n url: string;\n tooltip?: string;\n renderVariables?: boolean;\n targetBlank?: boolean;\n}\n\nexport interface PanelDisplay {\n name: string;\n description?: string;\n}\n\nexport interface PanelDefinition<PluginSpec = UnknownSpec> extends Definition<PanelSpec<PluginSpec>> {\n kind: 'Panel';\n}\n\nexport interface PanelSpec<PluginSpec = UnknownSpec> {\n display: PanelDisplay;\n plugin: Definition<PluginSpec>;\n queries?: QueryDefinition[];\n links?: Link[];\n}\n\n/**\n * A reference to a panel defined in the DashboardSpec.\n */\nexport interface PanelRef {\n $ref: `#/spec/panels/${string}`;\n}\n\nexport type PanelGroupId = number;\n\n/**\n * Panel values that can be edited in the panel editor.\n */\nexport interface PanelEditorValues {\n groupId: PanelGroupId;\n panelDefinition: PanelDefinition;\n}\n\nexport interface ExportFormat {\n name: string;\n extension: string;\n mimeType: string;\n}\n\nexport interface ExportData {\n format: ExportFormat;\n data: Blob;\n filename: string;\n}\n\nexport interface DataExportCapability {\n getSupportedFormats(): ExportFormat[];\n exportData(format: ExportFormat, options?: ExportOptions): Promise<ExportData>;\n}\nexport interface ExportOptions {\n title?: string;\n projectName?: string;\n customFilename?: string;\n includeMetadata?: boolean;\n}\n\nexport const EXPORT_FORMATS = {\n CSV: { name: 'CSV', extension: 'csv', mimeType: 'text/csv' },\n JSON: { name: 'JSON', extension: 'json', mimeType: 'application/json' },\n} as const;\n"],"names":["EXPORT_FORMATS","CSV","name","extension","mimeType","JSON"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAqEjC,OAAO,MAAMA,iBAAiB;IAC5BC,KAAK;QAAEC,MAAM;QAAOC,WAAW;QAAOC,UAAU;IAAW;IAC3DC,MAAM;QAAEH,MAAM;QAAQC,WAAW;QAAQC,UAAU;IAAmB;AACxE,EAAW"}
|
package/dist/model/query.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Definition, UnknownSpec } from './definitions';
|
|
2
2
|
import { TimeSeriesData } from './time-series-data';
|
|
3
3
|
import { TraceData } from './trace-data';
|
|
4
|
-
import { ProfileData } from './profile-data';
|
|
5
4
|
interface QuerySpec<PluginSpec> {
|
|
6
5
|
plugin: Definition<PluginSpec>;
|
|
7
6
|
}
|
|
@@ -18,7 +17,6 @@ export interface QueryDefinition<Kind = any, PluginSpec = UnknownSpec> {
|
|
|
18
17
|
export interface QueryType {
|
|
19
18
|
TimeSeriesQuery: TimeSeriesData;
|
|
20
19
|
TraceQuery: TraceData;
|
|
21
|
-
ProfileQuery: ProfileData;
|
|
22
20
|
}
|
|
23
21
|
/**
|
|
24
22
|
* Check if the given type is a valid {@link QueryPluginType} with compile time safety
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/model/query.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/model/query.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,UAAU,SAAS,CAAC,UAAU;IAC5B,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;CAChC;AACD;;GAEG;AAGH,MAAM,WAAW,eAAe,CAAC,IAAI,GAAG,GAAG,EAAE,UAAU,GAAG,WAAW;IACnE,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,eAAe,EAAE,cAAc,CAAC;IAChC,UAAU,EAAE,SAAS,CAAC;CAGvB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,eAAe,CAE5E;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,SAAS,CAAC;AAE9C;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,CAAC,MAAM,SAAS,CAAC,CAAC"}
|
package/dist/model/query.js
CHANGED
package/dist/model/query.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/query.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Definition, UnknownSpec } from './definitions';\nimport { TimeSeriesData } from './time-series-data';\nimport { TraceData } from './trace-data';\
|
|
1
|
+
{"version":3,"sources":["../../src/model/query.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Definition, UnknownSpec } from './definitions';\nimport { TimeSeriesData } from './time-series-data';\nimport { TraceData } from './trace-data';\n\ninterface QuerySpec<PluginSpec> {\n plugin: Definition<PluginSpec>;\n}\n/**\n * A generic query definition interface that can be extended to support more than just TimeSeriesQuery\n */\n// Kind needs to be `any` because otherwise typescript will complain 'unknown' is not assignable to type '\"TimeSeriesQuery\"' in a few places\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface QueryDefinition<Kind = any, PluginSpec = UnknownSpec> {\n kind: Kind;\n spec: QuerySpec<PluginSpec>;\n}\n\n/**\n * Mapping the query plugin to the data type it returns\n */\nexport interface QueryType {\n TimeSeriesQuery: TimeSeriesData;\n TraceQuery: TraceData;\n // in the future we can add other query plugin and data types\n // for example: we can add something like `LogsQuery: LogsData;`\n}\n\n/**\n * Check if the given type is a valid {@link QueryPluginType} with compile time safety\n * @param type\n */\nexport function isValidQueryPluginType(type: string): type is QueryPluginType {\n return ['TimeSeriesQuery', 'TraceQuery'].includes(type as QueryPluginType);\n}\n\n/**\n * Extract the keys of QueryType\n * ex: 'TimeSeriesQuery'\n */\nexport type QueryPluginType = keyof QueryType;\n\n/**\n * Values of QueryType\n * ex: 'TimeSeriesData'\n */\nexport type QueryDataType = QueryType[keyof QueryType];\n"],"names":["isValidQueryPluginType","type","includes"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AA6BjC;;;CAGC,GACD,OAAO,SAASA,uBAAuBC,IAAY;IACjD,OAAO;QAAC;QAAmB;KAAa,CAACC,QAAQ,CAACD;AACpD"}
|
|
@@ -1,23 +1,11 @@
|
|
|
1
1
|
import { TimeScale, TimeSeries, TimeSeriesData, TimeSeriesValueTuple } from '../model';
|
|
2
2
|
export declare const MIN_STEP_INTERVAL_MS = 10;
|
|
3
|
-
/**
|
|
4
|
-
* Given a common time scale (see `getCommonTimeScale`), generates an array of
|
|
5
|
-
* timestamp values in ms for the x axis of a graph.
|
|
6
|
-
*/
|
|
7
|
-
export declare function getXValues(timeScale: TimeScale): number[];
|
|
8
3
|
/**
|
|
9
4
|
* Given a TimeSeries from a query and a common time scale (see `getCommonTimeScale`),
|
|
10
5
|
* processes the time series values, filling in any timestamps that are missing
|
|
11
6
|
* from the time series data with `null` values.
|
|
12
7
|
*/
|
|
13
8
|
export declare function getTimeSeriesValues(series: TimeSeries, timeScale: TimeScale): TimeSeriesValueTuple[];
|
|
14
|
-
/**
|
|
15
|
-
* [DEPRECATED] Used for legacy LineChart 'category' axis approach.
|
|
16
|
-
* Given a TimeSeries from a query and a common time scale (see `getCommonTimeScale`),
|
|
17
|
-
* gets the values for the y axis of a graph, filling in any timestamps that are
|
|
18
|
-
* missing from the time series data with `null` values.
|
|
19
|
-
*/
|
|
20
|
-
export declare function getYValues(series: TimeSeries, timeScale: TimeScale): Array<number | null>;
|
|
21
9
|
/**
|
|
22
10
|
* Given a list of running queries, calculates a common time scale for use on
|
|
23
11
|
* the x axis (i.e. start/end dates and a step that is divisible into all of
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-series-data.d.ts","sourceRoot":"","sources":["../../src/utils/time-series-data.ts"],"names":[],"mappings":"AAaA,OAAO,EAAqB,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAG1G,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC
|
|
1
|
+
{"version":3,"file":"time-series-data.d.ts","sourceRoot":"","sources":["../../src/utils/time-series-data.ts"],"names":[],"mappings":"AAaA,OAAO,EAAqB,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAG1G,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,GAAG,oBAAoB,EAAE,CAyBpG;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,GAAG,SAAS,CAAC,GACzE,SAAS,GAAG,SAAS,CAgFvB"}
|
|
@@ -12,18 +12,6 @@
|
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { gcd } from './mathjs';
|
|
14
14
|
export const MIN_STEP_INTERVAL_MS = 10;
|
|
15
|
-
/**
|
|
16
|
-
* Given a common time scale (see `getCommonTimeScale`), generates an array of
|
|
17
|
-
* timestamp values in ms for the x axis of a graph.
|
|
18
|
-
*/ export function getXValues(timeScale) {
|
|
19
|
-
const xValues = [];
|
|
20
|
-
let timestamp = timeScale.startMs;
|
|
21
|
-
while(timestamp <= timeScale.endMs){
|
|
22
|
-
xValues.push(timestamp);
|
|
23
|
-
timestamp += timeScale.stepMs;
|
|
24
|
-
}
|
|
25
|
-
return xValues;
|
|
26
|
-
}
|
|
27
15
|
/**
|
|
28
16
|
* Given a TimeSeries from a query and a common time scale (see `getCommonTimeScale`),
|
|
29
17
|
* processes the time series values, filling in any timestamps that are missing
|
|
@@ -58,31 +46,6 @@ export const MIN_STEP_INTERVAL_MS = 10;
|
|
|
58
46
|
}
|
|
59
47
|
return processedValues;
|
|
60
48
|
}
|
|
61
|
-
/**
|
|
62
|
-
* [DEPRECATED] Used for legacy LineChart 'category' axis approach.
|
|
63
|
-
* Given a TimeSeries from a query and a common time scale (see `getCommonTimeScale`),
|
|
64
|
-
* gets the values for the y axis of a graph, filling in any timestamps that are
|
|
65
|
-
* missing from the time series data with `null` values.
|
|
66
|
-
*/ export function getYValues(series, timeScale) {
|
|
67
|
-
let timestamp = timeScale.startMs;
|
|
68
|
-
const yValues = [];
|
|
69
|
-
for (const valueTuple of series.values){
|
|
70
|
-
// Fill in values up to the current series value timestamp with nulls
|
|
71
|
-
while(timestamp < valueTuple[0]){
|
|
72
|
-
yValues.push(null);
|
|
73
|
-
timestamp += timeScale.stepMs;
|
|
74
|
-
}
|
|
75
|
-
// Now add the current value since timestamp should match
|
|
76
|
-
yValues.push(valueTuple[1]);
|
|
77
|
-
timestamp += timeScale.stepMs;
|
|
78
|
-
}
|
|
79
|
-
// Add null values at the end of the series if necessary
|
|
80
|
-
while(timestamp <= timeScale.endMs){
|
|
81
|
-
yValues.push(null);
|
|
82
|
-
timestamp += timeScale.stepMs;
|
|
83
|
-
}
|
|
84
|
-
return yValues;
|
|
85
|
-
}
|
|
86
49
|
/**
|
|
87
50
|
* Given a list of running queries, calculates a common time scale for use on
|
|
88
51
|
* the x axis (i.e. start/end dates and a step that is divisible into all of
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/time-series-data.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { AbsoluteTimeRange, TimeScale, TimeSeries, TimeSeriesData, TimeSeriesValueTuple } from '../model';\nimport { gcd } from './mathjs';\n\nexport const MIN_STEP_INTERVAL_MS = 10;\n\n/**\n * Given a
|
|
1
|
+
{"version":3,"sources":["../../src/utils/time-series-data.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { AbsoluteTimeRange, TimeScale, TimeSeries, TimeSeriesData, TimeSeriesValueTuple } from '../model';\nimport { gcd } from './mathjs';\n\nexport const MIN_STEP_INTERVAL_MS = 10;\n\n/**\n * Given a TimeSeries from a query and a common time scale (see `getCommonTimeScale`),\n * processes the time series values, filling in any timestamps that are missing\n * from the time series data with `null` values.\n */\nexport function getTimeSeriesValues(series: TimeSeries, timeScale: TimeScale): TimeSeriesValueTuple[] {\n let timestamp = timeScale.startMs;\n\n const values = series.values;\n const processedValues: TimeSeriesValueTuple[] = [];\n\n for (const valueTuple of values) {\n // Fill in values up to the current series value timestamp with nulls\n while (timestamp < valueTuple[0]) {\n processedValues.push([timestamp, null]);\n timestamp += timeScale.stepMs;\n }\n\n // Now add the current value since timestamp should match\n processedValues.push([timestamp, valueTuple[1]]);\n timestamp += timeScale.stepMs;\n }\n\n // Add null values at the end of the series if necessary\n while (timestamp <= timeScale.endMs) {\n processedValues.push([timestamp, null]);\n timestamp += timeScale.stepMs;\n }\n\n return processedValues;\n}\n\n/**\n * Given a list of running queries, calculates a common time scale for use on\n * the x axis (i.e. start/end dates and a step that is divisible into all of\n * the queries' steps).\n */\nexport function getCommonTimeScale(\n seriesData: Array<TimeSeriesData | Pick<TimeSeries, 'values'> | undefined>\n): TimeScale | undefined {\n let timeRange: AbsoluteTimeRange | undefined = undefined;\n const steps: number[] = [];\n\n for (const data of seriesData) {\n if (data && 'timeRange' in data) {\n if (data === undefined || data.timeRange === undefined || data.stepMs === undefined) continue;\n\n // Keep track of query steps so we can calculate a common one for the graph\n steps.push(data.stepMs);\n\n // If we don't have an overall time range yet, just start with this one\n if (timeRange === undefined) {\n timeRange = data.timeRange;\n continue;\n }\n\n // Otherwise, see if this query has a start or end outside of the current\n // time range\n if (data.timeRange.start < timeRange.start) {\n timeRange.start = data.timeRange.start;\n }\n if (data.timeRange.end > timeRange.end) {\n timeRange.end = data.timeRange.end;\n }\n } else if (data && 'values' in data) {\n for (let i = 0; i < data.values.length; i++) {\n const values = data.values[i];\n if (values === undefined) {\n continue;\n }\n\n const [timestamp] = values;\n const start = new Date(timestamp);\n const end = new Date(timestamp);\n\n if (timeRange === undefined) {\n timeRange = {\n start,\n end,\n };\n continue;\n }\n\n if (start < timeRange.start) {\n timeRange.start = start;\n }\n\n if (end > timeRange.end) {\n timeRange.end = end;\n }\n }\n\n if (timeRange === undefined) return undefined;\n\n const startMs = timeRange.start.valueOf();\n const endMs = timeRange.end.valueOf();\n const rangeMs = endMs - startMs;\n\n return { startMs, endMs, rangeMs, stepMs: MIN_STEP_INTERVAL_MS };\n }\n }\n\n if (timeRange === undefined) return undefined;\n\n // Use the greatest common divisor of all step values as the overall step\n // for the x axis (or if only one query, just use that query's step value)\n let stepMs: number;\n if (steps.length === 1) {\n stepMs = steps[0] as number;\n } else {\n const calculatedStepMs = gcd(...steps);\n stepMs = calculatedStepMs < MIN_STEP_INTERVAL_MS ? MIN_STEP_INTERVAL_MS : calculatedStepMs;\n }\n\n const startMs = timeRange.start.valueOf();\n const endMs = timeRange.end.valueOf();\n const rangeMs = endMs - startMs;\n\n return { startMs, endMs, stepMs, rangeMs };\n}\n"],"names":["gcd","MIN_STEP_INTERVAL_MS","getTimeSeriesValues","series","timeScale","timestamp","startMs","values","processedValues","valueTuple","push","stepMs","endMs","getCommonTimeScale","seriesData","timeRange","undefined","steps","data","start","end","i","length","Date","valueOf","rangeMs","calculatedStepMs"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oE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MZ,QAAQG,UAAUK,GAAG,CAACI,OAAO;IACnC,MAAMC,UAAUb,QAAQN;IAExB,OAAO;QAAEA;QAASM;QAAOD;QAAQc;IAAQ;AAC3C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perses-dev/core",
|
|
3
|
-
"version": "0.0.0-snapshot-
|
|
3
|
+
"version": "0.0.0-snapshot-panel-actions-520389b",
|
|
4
4
|
"description": "Core functionality consumed by both the Perses UI and plugins",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/perses/perses/blob/main/README.md",
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 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
|
-
/**
|
|
14
|
-
* A stackTrace
|
|
15
|
-
* It corresponds to a function called during a program execution.
|
|
16
|
-
* Children of a function are functions called by the parent function during its execution.
|
|
17
|
-
*/ "use strict";
|
|
18
|
-
Object.defineProperty(exports, "__esModule", {
|
|
19
|
-
value: true
|
|
20
|
-
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A stackTrace
|
|
3
|
-
* It corresponds to a function called during a program execution.
|
|
4
|
-
* Children of a function are functions called by the parent function during its execution.
|
|
5
|
-
*/
|
|
6
|
-
export interface StackTrace {
|
|
7
|
-
id: number;
|
|
8
|
-
name: string;
|
|
9
|
-
level: number;
|
|
10
|
-
start: number;
|
|
11
|
-
end: number;
|
|
12
|
-
total: number;
|
|
13
|
-
self: number;
|
|
14
|
-
children: StackTrace[];
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Timeline attribute contains data to draw the chart showing the evolution of the profiled resource over time (CPU, memory, etc.).
|
|
18
|
-
* It is like a metric and it helps to identify bottlenecks.
|
|
19
|
-
*/
|
|
20
|
-
export interface Timeline {
|
|
21
|
-
startTime: number;
|
|
22
|
-
samples: number[];
|
|
23
|
-
durationDelta: number;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* An entire profile
|
|
27
|
-
* It is the stacktrace of the root function.
|
|
28
|
-
*/
|
|
29
|
-
export interface Profile {
|
|
30
|
-
stackTrace: StackTrace;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* A generalized data-model that will be used by Panel components
|
|
34
|
-
* to display profiles.
|
|
35
|
-
*/
|
|
36
|
-
export interface ProfileData {
|
|
37
|
-
profile: Profile;
|
|
38
|
-
timeline?: Timeline;
|
|
39
|
-
numTicks?: number;
|
|
40
|
-
maxSelf?: number;
|
|
41
|
-
metadata?: ProfileMetaData;
|
|
42
|
-
}
|
|
43
|
-
export interface ProfileMetaData {
|
|
44
|
-
spyName: string;
|
|
45
|
-
sampleRate: number;
|
|
46
|
-
units: string;
|
|
47
|
-
name: string;
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=profile-data.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile-data.d.ts","sourceRoot":"","sources":["../../src/model/profile-data.ts"],"names":[],"mappings":"AAaA;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,UAAU,EAAE,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 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
|
-
/**
|
|
14
|
-
* A stackTrace
|
|
15
|
-
* It corresponds to a function called during a program execution.
|
|
16
|
-
* Children of a function are functions called by the parent function during its execution.
|
|
17
|
-
*/ export { };
|
|
18
|
-
|
|
19
|
-
//# sourceMappingURL=profile-data.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/profile-data.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * A stackTrace\n * It corresponds to a function called during a program execution.\n * Children of a function are functions called by the parent function during its execution.\n */\nexport interface StackTrace {\n id: number; // index of function's name in names array\n name: string; // function's name\n level: number; // level of the function in the flame graph\n start: number; // time at which the function starts\n end: number; // time at which the function ends\n total: number; // total samples (including the samples in its children nodes)\n self: number; // self samples (excluding the samples in its children nodes)\n children: StackTrace[];\n}\n\n/**\n * Timeline attribute contains data to draw the chart showing the evolution of the profiled resource over time (CPU, memory, etc.).\n * It is like a metric and it helps to identify bottlenecks.\n */\nexport interface Timeline {\n startTime: number; // Time at which the timeline starts, as a Unix timestamp\n samples: number[]; // A sequence of samples starting at startTime, spaced by durationDelta seconds\n durationDelta: number; // Time delta between samples, in seconds\n}\n\n/**\n * An entire profile\n * It is the stacktrace of the root function.\n */\nexport interface Profile {\n stackTrace: StackTrace;\n}\n\n/**\n * A generalized data-model that will be used by Panel components\n * to display profiles.\n */\nexport interface ProfileData {\n profile: Profile;\n timeline?: Timeline;\n\n numTicks?: number; // Total number of samples\n maxSelf?: number; // Maximum self value in any node\n\n metadata?: ProfileMetaData;\n}\n\nexport interface ProfileMetaData {\n spyName: string; // Name of the spy / profiler used to generate the profile, if any\n sampleRate: number; // Sample rate at which the profiler was operating\n units: string; // The unit of measurement for the profiled data\n name: string; // A name that identifies the profile. [Is this really necessary?]\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;;;;CAIC,GA4CD,WAKC"}
|