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;
|
const name = ((results[0] || {}).metric || {}).name;
|
||||||
|
|
||||||
if (type === ExpressionResultType.TIME_SERIES_VALUES) {
|
if (type === ExpressionResultType.TIME_SERIES_VALUES) {
|
||||||
source[c.label || name] = results[0].values.map((d: { value: unknown }) => d.value) || [];
|
if (results.length === 1) {
|
||||||
return;
|
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) {
|
if (type === ExpressionResultType.SINGLE_VALUE) {
|
||||||
source[c.label || name] = results[0].values[0].value;
|
source[c.label || name] = results[0].values[0].value;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (([ExpressionResultType.RECORD_LIST, ExpressionResultType.SORTED_LIST] as string[]).includes(type)) {
|
if (([ExpressionResultType.RECORD_LIST, ExpressionResultType.SORTED_LIST] as string[]).includes(type)) {
|
||||||
source[name] = results[0].values;
|
source[name] = results[0].values;
|
||||||
|
@ -178,7 +178,6 @@ export function useSourceProcessor(
|
|||||||
|
|
||||||
return d;
|
return d;
|
||||||
});
|
});
|
||||||
console.log(source);
|
|
||||||
}
|
}
|
||||||
if (type === MetricQueryTypes.READHEATMAP) {
|
if (type === MetricQueryTypes.READHEATMAP) {
|
||||||
const resVal = Object.values(resp.data)[0] || {};
|
const resVal = Object.values(resp.data)[0] || {};
|
||||||
|
@ -56,7 +56,7 @@ limitations under the License. -->
|
|||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="item mb-10">
|
<div class="item mb-10" v-show="!isExpression">
|
||||||
<span class="label">{{ t("aggregation") }}</span>
|
<span class="label">{{ t("aggregation") }}</span>
|
||||||
<SelectSingle
|
<SelectSingle
|
||||||
:value="currentMetric.calculation"
|
:value="currentMetric.calculation"
|
||||||
@ -131,13 +131,9 @@ limitations under the License. -->
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
const isTopn = computed(() =>
|
const isTopn = computed(() =>
|
||||||
[
|
[ProtocolTypes.SortMetrics, ProtocolTypes.ReadSampledRecords, ProtocolTypes.ReadRecords].includes(
|
||||||
ProtocolTypes.SortMetrics,
|
metricTypes.value[props.index],
|
||||||
ProtocolTypes.ReadSampledRecords,
|
),
|
||||||
ProtocolTypes.ReadRecords,
|
|
||||||
ExpressionResultType.SORTED_LIST,
|
|
||||||
ExpressionResultType.RECORD_LIST,
|
|
||||||
].includes(metricTypes.value[props.index]),
|
|
||||||
);
|
);
|
||||||
function updateConfig(index: number, param: { [key: string]: string }) {
|
function updateConfig(index: number, param: { [key: string]: string }) {
|
||||||
const key = Object.keys(param)[0];
|
const key = Object.keys(param)[0];
|
||||||
|
Loading…
Reference in New Issue
Block a user