From b693348172bed5ef74ea83cfe7cfd11dd2e336aa Mon Sep 17 00:00:00 2001 From: Fine Date: Wed, 24 Aug 2022 11:29:29 +0800 Subject: [PATCH] update metric processor --- src/hooks/useProcessor.ts | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/hooks/useProcessor.ts b/src/hooks/useProcessor.ts index a5b3f486..dea25185 100644 --- a/src/hooks/useProcessor.ts +++ b/src/hooks/useProcessor.ts @@ -46,6 +46,7 @@ export function useQueryProcessor(config: any) { "ServiceRelation", "ServiceInstanceRelation", "EndpointRelation", + "ProcessRelation", ].includes(dashboardStore.entity); if (isRelation && !selectorStore.currentDestService) { return; @@ -93,28 +94,40 @@ export function useQueryProcessor(config: any) { dashboardStore.entity === "All" ? undefined : selectorStore.currentService.normal, - serviceInstanceName: dashboardStore.entity.includes("ServiceInstance") + 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: - dashboardStore.entity === "ServiceInstanceRelation" - ? selectorStore.currentDestPod && - selectorStore.currentDestPod.value - : undefined, + destServiceInstanceName: [ + "ServiceInstanceRelation", + "ProcessRelation", + ].includes(dashboardStore.entity) + ? 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, }, }; }