mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-13 08:17:33 +00:00
feat: update percentile
This commit is contained in:
parent
0db3c06770
commit
6555a1d5a6
@ -121,12 +121,23 @@ export function useExpressionsSourceProcessor(
|
||||
const name = ((results[0] || {}).metric || {}).name;
|
||||
|
||||
if (type === ExpressionResultType.TIME_SERIES_VALUES) {
|
||||
source[c.label || name] = results[0].values.map((d: { value: unknown }) => d.value) || [];
|
||||
return;
|
||||
if (results.length === 1) {
|
||||
source[c.label || name] = results[0].values.map((d: { value: unknown }) => d.value) || [];
|
||||
} else {
|
||||
const labels = (c.label || "").split(",").map((item: string) => item.replace(/^\s*|\s*$/g, ""));
|
||||
for (const item of results) {
|
||||
const values = item.values.map((d: { value: unknown }) => Number(d.value)) || [];
|
||||
const index = Number(item.metric.labels[0].value);
|
||||
if (labels[index]) {
|
||||
source[labels[index]] = values;
|
||||
} else {
|
||||
source[index] = values;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (type === ExpressionResultType.SINGLE_VALUE) {
|
||||
source[c.label || name] = results[0].values[0].value;
|
||||
return;
|
||||
}
|
||||
if (([ExpressionResultType.RECORD_LIST, ExpressionResultType.SORTED_LIST] as string[]).includes(type)) {
|
||||
source[name] = results[0].values;
|
||||
|
@ -178,7 +178,6 @@ export function useSourceProcessor(
|
||||
|
||||
return d;
|
||||
});
|
||||
console.log(source);
|
||||
}
|
||||
if (type === MetricQueryTypes.READHEATMAP) {
|
||||
const resVal = Object.values(resp.data)[0] || {};
|
||||
|
@ -56,7 +56,7 @@ limitations under the License. -->
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<div class="item mb-10">
|
||||
<div class="item mb-10" v-show="!isExpression">
|
||||
<span class="label">{{ t("aggregation") }}</span>
|
||||
<SelectSingle
|
||||
:value="currentMetric.calculation"
|
||||
@ -131,13 +131,9 @@ limitations under the License. -->
|
||||
);
|
||||
});
|
||||
const isTopn = computed(() =>
|
||||
[
|
||||
ProtocolTypes.SortMetrics,
|
||||
ProtocolTypes.ReadSampledRecords,
|
||||
ProtocolTypes.ReadRecords,
|
||||
ExpressionResultType.SORTED_LIST,
|
||||
ExpressionResultType.RECORD_LIST,
|
||||
].includes(metricTypes.value[props.index]),
|
||||
[ProtocolTypes.SortMetrics, ProtocolTypes.ReadSampledRecords, ProtocolTypes.ReadRecords].includes(
|
||||
metricTypes.value[props.index],
|
||||
),
|
||||
);
|
||||
function updateConfig(index: number, param: { [key: string]: string }) {
|
||||
const key = Object.keys(param)[0];
|
||||
|
Loading…
Reference in New Issue
Block a user