This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-booster-ui.git
The following commit(s) were added to refs/heads/main by this push:
new 9b1a5f7a fix: expressions (#278)
9b1a5f7a is described below
commit 9b1a5f7a74e676eef15c63c0d14bbdb6dc43cfac
Author: Fine0830 <[email protected]>
AuthorDate: Fri Jun 9 18:23:33 2023 +0800
fix: expressions (#278)
---
src/hooks/useExpressionsProcessor.ts | 6 +++---
src/views/dashboard/graphs/EndpointList.vue | 3 ++-
src/views/dashboard/graphs/InstanceList.vue | 3 ++-
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/hooks/useExpressionsProcessor.ts
b/src/hooks/useExpressionsProcessor.ts
index 94ca8378..667c2e2e 100644
--- a/src/hooks/useExpressionsProcessor.ts
+++ b/src/hooks/useExpressionsProcessor.ts
@@ -129,7 +129,7 @@ export async function useExpressionsQueryProcessor(config:
Indexable) {
}
}
if (type === ExpressionResultType.SINGLE_VALUE) {
- source[c.label || name] = results[0].values[0].value;
+ source[c.label || name] = (results[0].values[0] || {}).value;
}
if (([ExpressionResultType.RECORD_LIST,
ExpressionResultType.SORTED_LIST] as string[]).includes(type)) {
source[name] = results[0].values;
@@ -259,7 +259,7 @@ export async function useExpressionsQueryPodsMetrics(
if (subValues) {
d[name]["values"] = subValues;
}
- d[name]["avg"] = results[i].values[0].value;
+ d[name]["avg"] = (results[i].values[0] || {}).value;
const j = names.find((d: string) => d === name);
@@ -278,7 +278,7 @@ export async function useExpressionsQueryPodsMetrics(
if (!d[name]) {
d[name] = {};
}
- d[name]["avg"] = [results[0].values[0].value];
+ d[name]["avg"] = [(results[0].values[0] || {}).value];
if (subResults[0]) {
if (!d[subName]) {
d[subName] = {};
diff --git a/src/views/dashboard/graphs/EndpointList.vue
b/src/views/dashboard/graphs/EndpointList.vue
index 97f06a2a..7921abe0 100644
--- a/src/views/dashboard/graphs/EndpointList.vue
+++ b/src/views/dashboard/graphs/EndpointList.vue
@@ -179,9 +179,9 @@ limitations under the License. -->
);
endpoints.value = params.data;
colMetrics.value = params.names;
+ colSubMetrics.value = params.subNames;
metricTypes.value = params.metricTypesArr;
metricConfig.value = params.metricConfigArr;
- colSubMetrics.value = params.colSubMetrics;
emit("expressionTips", { tips: params.expressionsTips, subTips:
params.subExpressionsTips });
return;
@@ -216,6 +216,7 @@ limitations under the License. -->
...(props.config.metrics || []),
...(props.config.metricConfig || []),
...(props.config.expressions || []),
+ ...(props.config.subExpressions || []),
props.config.metricMode,
],
(data, old) => {
diff --git a/src/views/dashboard/graphs/InstanceList.vue
b/src/views/dashboard/graphs/InstanceList.vue
index 4bf74e3f..d04d47ff 100644
--- a/src/views/dashboard/graphs/InstanceList.vue
+++ b/src/views/dashboard/graphs/InstanceList.vue
@@ -215,7 +215,7 @@ limitations under the License. -->
);
instances.value = params.data;
colMetrics.value = params.names;
- colSubMetrics.value = params.colSubMetrics;
+ colSubMetrics.value = params.subNames;
metricTypes.value = params.metricTypesArr;
metricConfig.value = params.metricConfigArr;
emit("expressionTips", { tips: params.expressionsTips, subTips:
params.subExpressionsTips });
@@ -268,6 +268,7 @@ limitations under the License. -->
...(props.config.metrics || []),
...(props.config.metricConfig || []),
...(props.config.expressions || []),
+ ...(props.config.subExpressions || []),
props.config.metricMode,
],
(data, old) => {