mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-14 00:37:33 +00:00
update
This commit is contained in:
parent
6a1d6e555c
commit
9dbca48ea3
@ -331,6 +331,7 @@ export function usePodsSource(
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
const names: string[] = [];
|
const names: string[] = [];
|
||||||
|
const metricConfigArr: MetricConfigOpt[] = config.metricConfig || [];
|
||||||
const data = pods.map((d: Instance | any, idx: number) => {
|
const data = pods.map((d: Instance | any, idx: number) => {
|
||||||
config.metrics.map((name: string, index: number) => {
|
config.metrics.map((name: string, index: number) => {
|
||||||
const c: any = (config.metricConfig && config.metricConfig[index]) || {};
|
const c: any = (config.metricConfig && config.metricConfig[index]) || {};
|
||||||
@ -369,7 +370,6 @@ export function usePodsSource(
|
|||||||
const labelsIdx = (c.labelsIndex || "")
|
const labelsIdx = (c.labelsIndex || "")
|
||||||
.split(",")
|
.split(",")
|
||||||
.map((item: string) => item.replace(/^\s*|\s*$/g, ""));
|
.map((item: string) => item.replace(/^\s*|\s*$/g, ""));
|
||||||
console.log(resVal);
|
|
||||||
for (const item of resVal) {
|
for (const item of resVal) {
|
||||||
const values = item.values.values.map((d: { value: number }) =>
|
const values = item.values.values.map((d: { value: number }) =>
|
||||||
aggregation(Number(d.value), c)
|
aggregation(Number(d.value), c)
|
||||||
@ -411,12 +411,13 @@ export function usePodsSource(
|
|||||||
names.push(item.label);
|
names.push(item.label);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
metricConfigArr.splice(index, 0, c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return d;
|
return d;
|
||||||
});
|
});
|
||||||
return { data, names };
|
return { data, names, metricConfigArr };
|
||||||
}
|
}
|
||||||
export function useQueryTopologyMetrics(metrics: string[], ids: string[]) {
|
export function useQueryTopologyMetrics(metrics: string[], ids: string[]) {
|
||||||
const appStore = useAppStoreWithOut();
|
const appStore = useAppStoreWithOut();
|
||||||
|
@ -217,12 +217,21 @@ async function queryServiceMetrics(currentServices: Service[]) {
|
|||||||
if (!metricConfig.value.length) {
|
if (!metricConfig.value.length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { data, names } = usePodsSource(currentServices, json, {
|
const { data, names, metricConfigArr } = usePodsSource(
|
||||||
...props.config,
|
currentServices,
|
||||||
metricConfig: metricConfig.value,
|
json,
|
||||||
});
|
{
|
||||||
|
...props.config,
|
||||||
|
metricConfig: metricConfig.value,
|
||||||
|
}
|
||||||
|
);
|
||||||
services.value = data;
|
services.value = data;
|
||||||
colMetrics.value = names;
|
colMetrics.value = names;
|
||||||
|
|
||||||
|
// metricConfig.value = metricConfigArr;
|
||||||
|
console.log(names);
|
||||||
|
console.log(data);
|
||||||
|
console.log(metricConfigArr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
services.value = currentServices;
|
services.value = currentServices;
|
||||||
|
Loading…
Reference in New Issue
Block a user