From fb5b7363e328013ff5e5bdef4e52c572bf897e9f Mon Sep 17 00:00:00 2001 From: Fine Date: Mon, 8 Aug 2022 19:41:07 +0800 Subject: [PATCH] get process topology --- src/graphql/fragments/topology.ts | 1 - src/store/modules/ebpf.ts | 23 +++++++++++++++++-- src/types/ebpf.d.ts | 10 ++++++++ .../related/network-profiling/Content.vue | 5 +++- .../network-profiling/components/Topology.vue | 21 ++++++++++++++--- 5 files changed, 53 insertions(+), 7 deletions(-) diff --git a/src/graphql/fragments/topology.ts b/src/graphql/fragments/topology.ts index 9643a08b..edbd7380 100644 --- a/src/graphql/fragments/topology.ts +++ b/src/graphql/fragments/topology.ts @@ -83,7 +83,6 @@ export const ProcessTopology = { nodes { id name - type isReal serviceName serviceId diff --git a/src/store/modules/ebpf.ts b/src/store/modules/ebpf.ts index 5468ead5..66714b8b 100644 --- a/src/store/modules/ebpf.ts +++ b/src/store/modules/ebpf.ts @@ -1,4 +1,3 @@ -import { TaskListItem } from "./../../types/profile.d"; /** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -22,11 +21,12 @@ import { EBPFProfilingSchedule, EBPFTaskList, AnalyzationTrees, + ProcessNode, } from "@/types/ebpf"; import { store } from "@/store"; import graphql from "@/graphql"; import { AxiosResponse } from "axios"; - +import { Call } from "@/types/topology"; interface EbpfStore { taskList: EBPFTaskList[]; networkTasks: EBPFTaskList[]; @@ -40,6 +40,8 @@ interface EbpfStore { selectedTask: Recordable; selectedNetworkTask: Recordable; aggregateType: string; + nodes: ProcessNode[]; + calls: Call[]; } export const ebpfStore = defineStore({ @@ -57,6 +59,8 @@ export const ebpfStore = defineStore({ selectedTask: {}, selectedNetworkTask: {}, aggregateType: "COUNT", + nodes: [], + calls: [], }), actions: { setSelectedTask(task: EBPFTaskList) { @@ -207,6 +211,21 @@ export const ebpfStore = defineStore({ this.analyzeTrees = analysisEBPFResult.trees; return res.data; }, + async getProcessTopology(params: { + duration: any; + serviceInstanceId: string; + }) { + const res: AxiosResponse = await graphql + .query("getProcessTopology") + .params(params); + if (res.data.errors) { + this.nodes = []; + this.calls = []; + return res.data; + } + const topo = res.data.data; + return res.data; + }, }, }); diff --git a/src/types/ebpf.d.ts b/src/types/ebpf.d.ts index 40852074..3259f524 100644 --- a/src/types/ebpf.d.ts +++ b/src/types/ebpf.d.ts @@ -75,3 +75,13 @@ export type AnalyzationTrees = { dumpCount: number; stackType: string; }; +export type ProcessNode = { + id: string; + name: string; + serviceId: string; + serviceName: string; + serviceInstanceId: string; + serviceInstanceName: string; + name: string; + isReal: boolean; +}; diff --git a/src/views/dashboard/related/network-profiling/Content.vue b/src/views/dashboard/related/network-profiling/Content.vue index e173d36c..9b5aef64 100644 --- a/src/views/dashboard/related/network-profiling/Content.vue +++ b/src/views/dashboard/related/network-profiling/Content.vue @@ -19,13 +19,16 @@ limitations under the License. -->
-
EBPF Stack
+
+ +