diff --git a/src/graphql/fragments/ebpf.ts b/src/graphql/fragments/ebpf.ts index c012cde9..922957c0 100644 --- a/src/graphql/fragments/ebpf.ts +++ b/src/graphql/fragments/ebpf.ts @@ -34,7 +34,7 @@ export const createEBPFTask = { }; export const queryEBPFTasks = { variable: - "$serviceId: ID, $serviceInstanceId: ID, $targets: [EBPFProfilingTargetType!], triggerType: EBPFProfilingTriggerType", + "$serviceId: ID, $serviceInstanceId: ID, $targets: [EBPFProfilingTargetType!], $triggerType: EBPFProfilingTriggerType", query: ` queryEBPFTasks: queryEBPFProfilingTasks(serviceId: $serviceId, serviceInstanceId: $serviceInstanceId, targets: $targets, triggerType: $triggerType) { taskId diff --git a/src/store/data.ts b/src/store/data.ts index 85822711..2f007b22 100644 --- a/src/store/data.ts +++ b/src/store/data.ts @@ -49,8 +49,6 @@ export const ControlsTypes = [ "ContinuousProfiling", ]; export enum EBPFProfilingTriggerType { - // Appoint the task executing total duration - FIXED_TIME, - // Trigger by the reach the continuous profiling policy - CONTINUOUS_PROFILING, + FIXED_TIME = "FIXED_TIME", + CONTINUOUS_PROFILING = "CONTINUOUS_PROFILING", } diff --git a/src/store/modules/continous-profiling.ts b/src/store/modules/continous-profiling.ts index 8e447c12..2af4ee6b 100644 --- a/src/store/modules/continous-profiling.ts +++ b/src/store/modules/continous-profiling.ts @@ -23,6 +23,7 @@ import type { AxiosResponse } from "axios"; import type { Call } from "@/types/topology"; import type { LayoutConfig } from "@/types/dashboard"; import type { DurationTime } from "@/types/app"; +import { EBPFProfilingTriggerType } from "../data"; interface ContinousProfilingState { strategyList: Array>; @@ -156,6 +157,11 @@ export const continousProfilingStore = defineStore({ }; }); this.setSelectedStrategy(this.strategyList[0] || {}); + this.getContinousTaskList({ + serviceId: params.serviceId, + targets: [this.selectedStrategy.type], + triggerType: EBPFProfilingTriggerType.CONTINUOUS_PROFILING, + }); if (!this.strategyList.length) { this.nodes = []; this.calls = []; diff --git a/src/views/dashboard/related/continuous-profiling/Content.vue b/src/views/dashboard/related/continuous-profiling/Content.vue index 435da986..35fc3e6d 100644 --- a/src/views/dashboard/related/continuous-profiling/Content.vue +++ b/src/views/dashboard/related/continuous-profiling/Content.vue @@ -16,7 +16,7 @@ limitations under the License. -->
-
tasks
+
graph
@@ -25,6 +25,7 @@ limitations under the License. --> import type { PropType } from "vue"; import { useI18n } from "vue-i18n"; import PolicyList from "./components/PolicyList.vue"; + import TaskList from "./components/TaskList.vue"; /*global defineProps */ defineProps({ config: { diff --git a/src/views/dashboard/related/continuous-profiling/components/PolicyList.vue b/src/views/dashboard/related/continuous-profiling/components/PolicyList.vue index 967aa36a..9f9baff1 100644 --- a/src/views/dashboard/related/continuous-profiling/components/PolicyList.vue +++ b/src/views/dashboard/related/continuous-profiling/components/PolicyList.vue @@ -70,6 +70,7 @@ limitations under the License. --> import type { StrategyItem, CheckItems } from "@/types/continous-profiling"; import { ElMessage } from "element-plus"; import EditPolicy from "./EditPolicy.vue"; + import { EBPFProfilingTriggerType } from "@/store/data"; const { t } = useI18n(); const selectorStore = useSelectorStore(); @@ -85,6 +86,12 @@ limitations under the License. --> async function changePolicy(item: StrategyItem) { continousProfilingStore.setSelectedStrategy(item); + const serviceId = (selectorStore.currentService && selectorStore.currentService.id) || ""; + await continousProfilingStore.getContinousTaskList({ + serviceId, + targets: [item.type], + triggerType: EBPFProfilingTriggerType.CONTINUOUS_PROFILING, + }); } function setStrategies() { diff --git a/src/views/dashboard/related/continuous-profiling/components/TaskList.vue b/src/views/dashboard/related/continuous-profiling/components/TaskList.vue index e69de29b..a0ade23b 100644 --- a/src/views/dashboard/related/continuous-profiling/components/TaskList.vue +++ b/src/views/dashboard/related/continuous-profiling/components/TaskList.vue @@ -0,0 +1,137 @@ + + + +