mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-14 00:37:33 +00:00
refactor query source
This commit is contained in:
parent
3bc2011a78
commit
989212810b
@ -381,35 +381,23 @@ export function usePodsSource(
|
|||||||
aggregation(Number(d.value), c)
|
aggregation(Number(d.value), c)
|
||||||
);
|
);
|
||||||
const indexNum = labelsIdx.findIndex((d: string) => d === item.label);
|
const indexNum = labelsIdx.findIndex((d: string) => d === item.label);
|
||||||
|
let key = item.label;
|
||||||
if (labels[indexNum] && indexNum > -1) {
|
if (labels[indexNum] && indexNum > -1) {
|
||||||
if (!d[labels[indexNum]]) {
|
key = labels[indexNum];
|
||||||
d[labels[indexNum]] = {};
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
[
|
|
||||||
Calculations.Average,
|
|
||||||
Calculations.ApdexAvg,
|
|
||||||
Calculations.PercentageAvg,
|
|
||||||
].includes(c.calculation)
|
|
||||||
) {
|
|
||||||
d[labels[indexNum]]["avg"] = calculateExp(item.values.values, c);
|
|
||||||
}
|
|
||||||
d[labels[indexNum]]["values"] = values;
|
|
||||||
} else {
|
|
||||||
if (!d[item.label]) {
|
|
||||||
d[item.label] = {};
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
[
|
|
||||||
Calculations.Average,
|
|
||||||
Calculations.ApdexAvg,
|
|
||||||
Calculations.PercentageAvg,
|
|
||||||
].includes(c.calculation)
|
|
||||||
) {
|
|
||||||
d[item.label]["avg"] = calculateExp(item.values.values, c);
|
|
||||||
}
|
|
||||||
d[item.label]["values"] = values;
|
|
||||||
}
|
}
|
||||||
|
if (!d[key]) {
|
||||||
|
d[key] = {};
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
[
|
||||||
|
Calculations.Average,
|
||||||
|
Calculations.ApdexAvg,
|
||||||
|
Calculations.PercentageAvg,
|
||||||
|
].includes(c.calculation)
|
||||||
|
) {
|
||||||
|
d[key]["avg"] = calculateExp(item.values.values, c);
|
||||||
|
}
|
||||||
|
d[key]["values"] = values;
|
||||||
if (idx === 0) {
|
if (idx === 0) {
|
||||||
names.push(item.label);
|
names.push(item.label);
|
||||||
metricConfigArr.push({ ...c, index: i });
|
metricConfigArr.push({ ...c, index: i });
|
||||||
|
Loading…
Reference in New Issue
Block a user