You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2022/11/28 14:49:28 UTC
[skywalking-booster-ui] branch main updated: fix: add `ProcessRelation` to entity types (#194)
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 5be106f fix: add `ProcessRelation` to entity types (#194)
5be106f is described below
commit 5be106fc4f9aa0dc2103f35cc438dccb60b7031d
Author: Fine0830 <fa...@gmail.com>
AuthorDate: Mon Nov 28 22:49:23 2022 +0800
fix: add `ProcessRelation` to entity types (#194)
---
src/hooks/useMetricsProcessor.ts | 133 ++++++++++-----------
src/layout/components/SideBar.vue | 2 +-
src/views/dashboard/data.ts | 1 +
src/views/dashboard/graphs/TopList.vue | 6 +-
.../network-profiling/components/NewTask.vue | 4 +-
5 files changed, 73 insertions(+), 73 deletions(-)
diff --git a/src/hooks/useMetricsProcessor.ts b/src/hooks/useMetricsProcessor.ts
index 979d950..adefcd2 100644
--- a/src/hooks/useMetricsProcessor.ts
+++ b/src/hooks/useMetricsProcessor.ts
@@ -73,79 +73,74 @@ export function useQueryProcessor(config: any) {
topN: c.topN || 10,
order: c.sortOrder || "DES",
};
- } else if ([MetricQueryTypes.ReadRecords].includes(metricType)) {
- variables.push(`$condition${index}: RecordCondition!`);
- conditions[`condition${index}`] = {
- name,
- parentEntity: {
- scope: config.catalog,
- normal: selectorStore.currentService
- ? selectorStore.currentService.normal
- : true,
- serviceName: ["All"].includes(dashboardStore.entity)
- ? null
- : selectorStore.currentService.value,
- },
- topN: c.topN || 10,
- order: c.sortOrder || "DES",
- };
} else {
- if (metricType === MetricQueryTypes.ReadLabeledMetricsValues) {
- const labels = (c.labelsIndex || "")
- .split(",")
- .map((item: string) => item.replace(/^\s*|\s*$/g, ""));
- variables.push(`$labels${index}: [String!]!`);
- conditions[`labels${index}`] = labels;
- }
- variables.push(`$condition${index}: MetricsCondition!`);
- conditions[`condition${index}`] = {
- name,
- entity: {
- scope: dashboardStore.entity,
- serviceName:
- dashboardStore.entity === "All"
- ? undefined
- : selectorStore.currentService.value,
- normal:
- dashboardStore.entity === "All"
- ? undefined
- : selectorStore.currentService.normal,
- serviceInstanceName: [
- "ServiceInstance",
- "ServiceInstanceRelation",
- "ProcessRelation",
- ].includes(dashboardStore.entity)
- ? selectorStore.currentPod && selectorStore.currentPod.value
- : undefined,
- endpointName: dashboardStore.entity.includes("Endpoint")
- ? selectorStore.currentPod && selectorStore.currentPod.value
- : undefined,
- processName: dashboardStore.entity.includes("Process")
- ? selectorStore.currentProcess && selectorStore.currentProcess.value
- : undefined,
- destNormal: isRelation
- ? selectorStore.currentDestService.normal
- : undefined,
- destServiceName: isRelation
- ? selectorStore.currentDestService.value
- : undefined,
- destServiceInstanceName: [
- "ServiceInstanceRelation",
- "ProcessRelation",
- ].includes(dashboardStore.entity)
+ const entity = {
+ scope: config.catalog,
+ serviceName:
+ dashboardStore.entity === "All"
+ ? undefined
+ : selectorStore.currentService.value,
+ normal:
+ dashboardStore.entity === "All"
+ ? undefined
+ : selectorStore.currentService.normal,
+ serviceInstanceName: [
+ "ServiceInstance",
+ "ServiceInstanceRelation",
+ "ProcessRelation",
+ ].includes(dashboardStore.entity)
+ ? selectorStore.currentPod && selectorStore.currentPod.value
+ : undefined,
+ endpointName: dashboardStore.entity.includes("Endpoint")
+ ? selectorStore.currentPod && selectorStore.currentPod.value
+ : undefined,
+ processName: dashboardStore.entity.includes("Process")
+ ? selectorStore.currentProcess && selectorStore.currentProcess.value
+ : undefined,
+ destNormal: isRelation
+ ? selectorStore.currentDestService.normal
+ : undefined,
+ destServiceName: isRelation
+ ? selectorStore.currentDestService.value
+ : undefined,
+ destServiceInstanceName: [
+ "ServiceInstanceRelation",
+ "ProcessRelation",
+ ].includes(dashboardStore.entity)
+ ? selectorStore.currentDestPod && selectorStore.currentDestPod.value
+ : undefined,
+ destEndpointName:
+ dashboardStore.entity === "EndpointRelation"
? selectorStore.currentDestPod && selectorStore.currentDestPod.value
: undefined,
- destEndpointName:
- dashboardStore.entity === "EndpointRelation"
- ? selectorStore.currentDestPod &&
- selectorStore.currentDestPod.value
- : undefined,
- destProcessName: dashboardStore.entity.includes("ProcessRelation")
- ? selectorStore.currentDestProcess &&
- selectorStore.currentDestProcess.value
- : undefined,
- },
+ destProcessName: dashboardStore.entity.includes("ProcessRelation")
+ ? selectorStore.currentDestProcess &&
+ selectorStore.currentDestProcess.value
+ : undefined,
};
+ if ([MetricQueryTypes.ReadRecords].includes(metricType)) {
+ variables.push(`$condition${index}: RecordCondition!`);
+ conditions[`condition${index}`] = {
+ name,
+ parentEntity: entity,
+ topN: c.topN || 10,
+ order: c.sortOrder || "DES",
+ };
+ } else {
+ entity.scope = dashboardStore.entity;
+ if (metricType === MetricQueryTypes.ReadLabeledMetricsValues) {
+ const labels = (c.labelsIndex || "")
+ .split(",")
+ .map((item: string) => item.replace(/^\s*|\s*$/g, ""));
+ variables.push(`$labels${index}: [String!]!`);
+ conditions[`labels${index}`] = labels;
+ }
+ variables.push(`$condition${index}: MetricsCondition!`);
+ conditions[`condition${index}`] = {
+ name,
+ entity,
+ };
+ }
}
if (metricType === MetricQueryTypes.ReadLabeledMetricsValues) {
return `${name}${index}: ${metricType}(condition: $condition${index}, labels: $labels${index}, duration: $duration)${RespFields[metricType]}`;
diff --git a/src/layout/components/SideBar.vue b/src/layout/components/SideBar.vue
index 403f56c..8414697 100644
--- a/src/layout/components/SideBar.vue
+++ b/src/layout/components/SideBar.vue
@@ -107,7 +107,7 @@ if (/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent)) {
} else {
appStore.setIsMobile(false);
}
-const isCollapse = ref(true);
+const isCollapse = ref(false);
const controlMenu = () => {
isCollapse.value = !isCollapse.value;
};
diff --git a/src/views/dashboard/data.ts b/src/views/dashboard/data.ts
index ff3d28a..b386e28 100644
--- a/src/views/dashboard/data.ts
+++ b/src/views/dashboard/data.ts
@@ -145,6 +145,7 @@ export enum MetricCatalog {
SERVICE_RELATION = "ServiceRelation",
SERVICE_INSTANCE_RELATION = "ServiceInstanceRelation",
ENDPOINT_RELATION = "EndpointRelation",
+ PROCESS_RELATION = "ProcessRelation",
}
export const EntityType = [
{ value: "Service", label: "Service", key: 1 },
diff --git a/src/views/dashboard/graphs/TopList.vue b/src/views/dashboard/graphs/TopList.vue
index 91aab28..aac7fce 100644
--- a/src/views/dashboard/graphs/TopList.vue
+++ b/src/views/dashboard/graphs/TopList.vue
@@ -43,7 +43,11 @@ limitations under the License. -->
</div>
<el-progress
:stroke-width="6"
- :percentage="(i.value / maxValue) * 100"
+ :percentage="
+ isNaN(Number(i.value) / maxValue)
+ ? 0
+ : (Number(i.value) / maxValue) * 100
+ "
:color="TextColors[config.color || 'purple']"
:show-text="false"
/>
diff --git a/src/views/dashboard/related/network-profiling/components/NewTask.vue b/src/views/dashboard/related/network-profiling/components/NewTask.vue
index 9bce52a..44b2058 100644
--- a/src/views/dashboard/related/network-profiling/components/NewTask.vue
+++ b/src/views/dashboard/related/network-profiling/components/NewTask.vue
@@ -69,8 +69,8 @@ const activeNames = ref([0]);
const conditionsList = ref<NetworkProfilingRequest[]>([
{
uriRegex: "",
- when4xx: InitTaskField.Whenxx[0].value,
- when5xx: InitTaskField.Whenxx[1].value,
+ when4xx: InitTaskField.Whenxx[1].value,
+ when5xx: InitTaskField.Whenxx[0].value,
minDuration: NaN,
},
]);