feat: support multiple metrics for querys

This commit is contained in:
Qiuxia Fan
2022-01-20 20:17:19 +08:00
parent 86ec9c985b
commit 37fad917fb
10 changed files with 164 additions and 56 deletions

View File

@@ -26,6 +26,8 @@ export const NewControl = {
},
graph: {},
standard: {},
metrics: [],
metricTypes: [],
};
export const ConfigData: any = {
x: 0,
@@ -33,8 +35,8 @@ export const ConfigData: any = {
w: 8,
h: 12,
i: "0",
metrics: ["service_resp_time"],
metricTypes: ["readMetricsValues"],
metrics: ["service_resp_time", "service_cpm"],
metricTypes: ["readMetricsValues", "readMetricsValues"],
type: "Widget",
widget: {
title: "Title",
@@ -49,3 +51,39 @@ export const ConfigData: any = {
},
children: [],
};
export const RespFields: any = {
readMetricsValues: `{
label
values {
values {value}
}
}`,
readMetricsValue: "",
sortMetrics: `{
name
id
value
refId
}`,
readLabeledMetricsValues: `{
label
values {
values {value}
}
}`,
readHeatMap: `{
values {
id
values
}
buckets {
min
max
}
}`,
readSampledRecords: `{
name
value
refId
}`,
};