mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-13 08:17:33 +00:00
feat: exclude empty data
This commit is contained in:
parent
8bcc886017
commit
1414ded4f6
@ -71,7 +71,7 @@ export const RespFields: Indexable = {
|
|||||||
readMetricsValues: `{
|
readMetricsValues: `{
|
||||||
label
|
label
|
||||||
values {
|
values {
|
||||||
values {value}
|
values {value isEmptyValue}
|
||||||
}
|
}
|
||||||
}`,
|
}`,
|
||||||
readMetricsValue: ``,
|
readMetricsValue: ``,
|
||||||
@ -88,7 +88,7 @@ export const RespFields: Indexable = {
|
|||||||
readLabeledMetricsValues: `{
|
readLabeledMetricsValues: `{
|
||||||
label
|
label
|
||||||
values {
|
values {
|
||||||
values {value}
|
values {value isEmptyValue}
|
||||||
}
|
}
|
||||||
}`,
|
}`,
|
||||||
readHeatMap: `{
|
readHeatMap: `{
|
||||||
|
@ -361,7 +361,8 @@ export function useQueryTopologyMetrics(metrics: string[], ids: string[]) {
|
|||||||
|
|
||||||
return { queryStr, conditions };
|
return { queryStr, conditions };
|
||||||
}
|
}
|
||||||
function calculateExp(arr: { value: number }[], config: { calculation?: string }): (number | string)[] {
|
function calculateExp(list: { value: number }[], config: { calculation?: string }): (number | string)[] {
|
||||||
|
const arr = list.filter((d: any) => !d.isEmptyValue);
|
||||||
const sum = arr.map((d: { value: number }) => d.value).reduce((a, b) => a + b);
|
const sum = arr.map((d: { value: number }) => d.value).reduce((a, b) => a + b);
|
||||||
let data: (number | string)[] = [];
|
let data: (number | string)[] = [];
|
||||||
switch (config.calculation) {
|
switch (config.calculation) {
|
||||||
|
Loading…
Reference in New Issue
Block a user