mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-02 17:04:48 +00:00
feat: add readRecords
to metric types (#172)
This commit is contained in:
parent
77d189cdfb
commit
5e161f17c2
@ -21,6 +21,7 @@ export enum MetricQueryTypes {
|
|||||||
ReadLabeledMetricsValues = "readLabeledMetricsValues",
|
ReadLabeledMetricsValues = "readLabeledMetricsValues",
|
||||||
READHEATMAP = "readHeatMap",
|
READHEATMAP = "readHeatMap",
|
||||||
ReadSampledRecords = "readSampledRecords",
|
ReadSampledRecords = "readSampledRecords",
|
||||||
|
ReadRecords = "readRecords",
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum Calculations {
|
export enum Calculations {
|
||||||
@ -101,4 +102,10 @@ export const RespFields: any = {
|
|||||||
value
|
value
|
||||||
refId
|
refId
|
||||||
}`,
|
}`,
|
||||||
|
readRecords: `{
|
||||||
|
id
|
||||||
|
name
|
||||||
|
value
|
||||||
|
refId
|
||||||
|
}`,
|
||||||
};
|
};
|
||||||
|
@ -73,6 +73,22 @@ export function useQueryProcessor(config: any) {
|
|||||||
topN: c.topN || 10,
|
topN: c.topN || 10,
|
||||||
order: c.sortOrder || "DES",
|
order: c.sortOrder || "DES",
|
||||||
};
|
};
|
||||||
|
} else if ([MetricQueryTypes.ReadRecords].includes(metricType)) {
|
||||||
|
variables.push(`$condition${index}: RecordCondition!`);
|
||||||
|
conditions[`condition${index}`] = {
|
||||||
|
name,
|
||||||
|
parentEntity: {
|
||||||
|
scope: config.catalog,
|
||||||
|
normal: selectorStore.currentService
|
||||||
|
? selectorStore.currentService.normal
|
||||||
|
: true,
|
||||||
|
serviceName: ["All"].includes(dashboardStore.entity)
|
||||||
|
? null
|
||||||
|
: selectorStore.currentService.value,
|
||||||
|
},
|
||||||
|
topN: c.topN || 10,
|
||||||
|
order: c.sortOrder || "DES",
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
if (metricType === MetricQueryTypes.ReadLabeledMetricsValues) {
|
if (metricType === MetricQueryTypes.ReadLabeledMetricsValues) {
|
||||||
const labels = (c.labelsIndex || "")
|
const labels = (c.labelsIndex || "")
|
||||||
@ -435,6 +451,7 @@ export async function useGetMetricEntity(metric: string, metricType: any) {
|
|||||||
[
|
[
|
||||||
MetricQueryTypes.ReadSampledRecords,
|
MetricQueryTypes.ReadSampledRecords,
|
||||||
MetricQueryTypes.SortMetrics,
|
MetricQueryTypes.SortMetrics,
|
||||||
|
MetricQueryTypes.ReadRecords,
|
||||||
].includes(metricType)
|
].includes(metricType)
|
||||||
) {
|
) {
|
||||||
const res = await dashboardStore.fetchMetricList(metric);
|
const res = await dashboardStore.fetchMetricList(metric);
|
||||||
|
@ -45,6 +45,7 @@ export const MetricChartType: any = {
|
|||||||
readLabeledMetricsValues: [{ label: "Line", value: "Line" }],
|
readLabeledMetricsValues: [{ label: "Line", value: "Line" }],
|
||||||
readHeatMap: [{ label: "Heat Map", value: "HeatMap" }],
|
readHeatMap: [{ label: "Heat Map", value: "HeatMap" }],
|
||||||
readSampledRecords: [{ label: "Top List", value: "TopList" }],
|
readSampledRecords: [{ label: "Top List", value: "TopList" }],
|
||||||
|
readRecords: [{ label: "Top List", value: "TopList" }],
|
||||||
};
|
};
|
||||||
export const DefaultGraphConfig: { [key: string]: any } = {
|
export const DefaultGraphConfig: { [key: string]: any } = {
|
||||||
Bar: {
|
Bar: {
|
||||||
@ -134,6 +135,7 @@ export const MetricTypes: {
|
|||||||
{ label: "read heatmap values in the duration", value: "readHeatMap" },
|
{ label: "read heatmap values in the duration", value: "readHeatMap" },
|
||||||
],
|
],
|
||||||
SAMPLED_RECORD: [
|
SAMPLED_RECORD: [
|
||||||
|
{ label: "get sorted topN values", value: "readRecords" },
|
||||||
{ label: "get sorted topN values", value: "readSampledRecords" },
|
{ label: "get sorted topN values", value: "readSampledRecords" },
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user