diff --git a/src/store/modules/network-profiling.ts b/src/store/modules/network-profiling.ts deleted file mode 100644 index b1bbedf9..00000000 --- a/src/store/modules/network-profiling.ts +++ /dev/null @@ -1,154 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { defineStore } from "pinia"; -import { EBPFTaskList, ProcessNode } from "@/types/ebpf"; -import { store } from "@/store"; -import graphql from "@/graphql"; -import { AxiosResponse } from "axios"; -import { Call } from "@/types/topology"; -import { LayoutConfig } from "@/types/dashboard"; - -interface NetworkProfilingState { - networkTasks: EBPFTaskList[]; - networkTip: string; - selectedNetworkTask: Recordable; - nodes: ProcessNode[]; - calls: Call[]; - node: Nullable; - call: Nullable; - metricsLayout: LayoutConfig[]; - selectedMetric: Nullable; - activeMetricIndex: string; -} - -export const networkProfilingStore = defineStore({ - id: "networkProfiling", - state: (): NetworkProfilingState => ({ - networkTasks: [], - networkTip: "", - selectedNetworkTask: {}, - nodes: [], - calls: [], - node: null, - call: null, - metricsLayout: [], - selectedMetric: null, - activeMetricIndex: "", - }), - actions: { - setSelectedNetworkTask(task: EBPFTaskList) { - this.selectedNetworkTask = task || {}; - }, - setNode(node: Node) { - this.node = node; - }, - setLink(link: Call) { - this.call = link; - }, - setMetricsLayout(layout: LayoutConfig[]) { - this.metricsLayout = layout; - }, - setSelectedMetric(item: LayoutConfig) { - this.selectedMetric = item; - }, - setActiveItem(index: string) { - this.activeMetricIndex = index; - }, - setTopology(data: { nodes: ProcessNode[]; calls: Call[] }) { - const obj = {} as any; - const calls = (data.calls || []).reduce((prev: Call[], next: Call) => { - if (!obj[next.id]) { - obj[next.id] = true; - next.value = next.value || 1; - for (const node of data.nodes) { - if (next.source === node.id) { - next.sourceObj = node; - } - if (next.target === node.id) { - next.targetObj = node; - } - } - next.value = next.value || 1; - prev.push(next); - } - return prev; - }, []); - - this.calls = calls; - this.nodes = data.nodes; - }, - async createNetworkTask(param: { - serviceId: string; - serviceInstanceId: string; - }) { - const res: AxiosResponse = await graphql - .query("newNetworkProfiling") - .params({ request: { instanceId: param.serviceInstanceId } }); - - if (res.data.errors) { - return res.data; - } - this.getTaskList({ - ...param, - targets: ["NETWORK"], - }); - return res.data; - }, - async getTaskList(params: { - serviceId: string; - serviceInstanceId: string; - targets: string[]; - }) { - if (!params.serviceId) { - return new Promise((resolve) => resolve({})); - } - const res: AxiosResponse = await graphql - .query("getEBPFTasks") - .params(params); - - this.networkTip = ""; - if (res.data.errors) { - return res.data; - } - this.networkTasks = res.data.data.queryEBPFTasks || []; - this.selectedNetworkTask = this.networkTasks[0] || {}; - this.setSelectedNetworkTask(this.selectedNetworkTask); - 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 { topology } = res.data.data; - - this.setTopology(topology); - return res.data; - }, - }, -}); - -export function useNetworkProfilingStore(): any { - return networkProfilingStore(store); -} diff --git a/src/views/dashboard/controls/NetworkProfiling.vue b/src/views/dashboard/controls/NetworkProfiling.vue deleted file mode 100644 index d5dfd490..00000000 --- a/src/views/dashboard/controls/NetworkProfiling.vue +++ /dev/null @@ -1,97 +0,0 @@ - - - - diff --git a/src/views/dashboard/controls/index.ts b/src/views/dashboard/controls/index.ts index 2633ce8d..8130b98c 100644 --- a/src/views/dashboard/controls/index.ts +++ b/src/views/dashboard/controls/index.ts @@ -24,7 +24,6 @@ import Text from "./Text.vue"; import Ebpf from "./Ebpf.vue"; import DemandLog from "./DemandLog.vue"; import Event from "./Event.vue"; -import NetworkProfiling from "./NetworkProfiling.vue"; export default { Tab, @@ -37,5 +36,4 @@ export default { Ebpf, DemandLog, Event, - NetworkProfiling, }; diff --git a/src/views/dashboard/controls/tab.ts b/src/views/dashboard/controls/tab.ts index 90c33ed7..6f7ce33b 100644 --- a/src/views/dashboard/controls/tab.ts +++ b/src/views/dashboard/controls/tab.ts @@ -23,7 +23,6 @@ import Text from "./Text.vue"; import Ebpf from "./Ebpf.vue"; import DemandLog from "./DemandLog.vue"; import Event from "./Event.vue"; -import NetworkProfiling from "./NetworkProfiling.vue"; export default { Widget, @@ -35,5 +34,4 @@ export default { Ebpf, DemandLog, Event, - NetworkProfiling, }; diff --git a/src/views/dashboard/data.ts b/src/views/dashboard/data.ts index 934d3d69..dc396dc8 100644 --- a/src/views/dashboard/data.ts +++ b/src/views/dashboard/data.ts @@ -198,11 +198,6 @@ export const InstanceTools = [ { name: "assignment", content: "Add Log", id: "addLog" }, { name: "demand", content: "Add On Demand Log", id: "addDemandLog" }, { name: "event", content: "Add Event", id: "addEvent" }, - { - name: "timeline", - content: "Add Network Profiling", - id: "addNetworkProfiling", - }, ]; export const EndpointTools = [ { name: "playlist_add", content: "Add Widget", id: "addWidget" }, diff --git a/src/views/dashboard/panel/Tool.vue b/src/views/dashboard/panel/Tool.vue index 173cf61a..5ed57bb0 100644 --- a/src/views/dashboard/panel/Tool.vue +++ b/src/views/dashboard/panel/Tool.vue @@ -548,9 +548,6 @@ function setTabControls(id: string) { case "addEvent": dashboardStore.addTabControls("Event"); break; - case "addNetworkProfiling": - dashboardStore.addTabControls("NetworkProfiling"); - break; default: ElMessage.info("Don't support this control"); break; @@ -589,9 +586,6 @@ function setControls(id: string) { case "addEvent": dashboardStore.addControl("Event"); break; - case "addNetworkProfiling": - dashboardStore.addControl("NetworkProfiling"); - break; default: dashboardStore.addControl("Widget"); } diff --git a/src/views/dashboard/related/network-profiling/Content.vue b/src/views/dashboard/related/network-profiling/Content.vue deleted file mode 100644 index 2bcb441d..00000000 --- a/src/views/dashboard/related/network-profiling/Content.vue +++ /dev/null @@ -1,60 +0,0 @@ - - - - diff --git a/src/views/dashboard/related/network-profiling/components/ProcessTopology.vue b/src/views/dashboard/related/network-profiling/components/ProcessTopology.vue deleted file mode 100644 index 1b7e23cb..00000000 --- a/src/views/dashboard/related/network-profiling/components/ProcessTopology.vue +++ /dev/null @@ -1,272 +0,0 @@ - - - - diff --git a/src/views/dashboard/related/network-profiling/components/Schedules.vue b/src/views/dashboard/related/network-profiling/components/Schedules.vue deleted file mode 100644 index 6b6e7cae..00000000 --- a/src/views/dashboard/related/network-profiling/components/Schedules.vue +++ /dev/null @@ -1,113 +0,0 @@ - - - - diff --git a/src/views/dashboard/related/network-profiling/components/Tasks.vue b/src/views/dashboard/related/network-profiling/components/Tasks.vue deleted file mode 100644 index 8f8eba6b..00000000 --- a/src/views/dashboard/related/network-profiling/components/Tasks.vue +++ /dev/null @@ -1,238 +0,0 @@ - - - -