diff --git a/src/graphql/fragments/profile.ts b/src/graphql/fragments/profile.ts index b53ad4ff..cfe9a4f9 100644 --- a/src/graphql/fragments/profile.ts +++ b/src/graphql/fragments/profile.ts @@ -171,7 +171,7 @@ export const GetAsyncTaskList = { export const GetAsyncProfileTaskProcess = { variable: "$taskID: String", query: ` - taskLogs: queryAsyncProfilerTaskProgress(taskID: $taskID) { + taskProgress: queryAsyncProfilerTaskProgress(taskID: $taskID) { logs { id instanceId diff --git a/src/store/modules/async-profiling.ts b/src/store/modules/async-profiling.ts index 20fea5cd..6a71c0d2 100644 --- a/src/store/modules/async-profiling.ts +++ b/src/store/modules/async-profiling.ts @@ -19,13 +19,17 @@ import type { Option } from "@/types/app"; import type { AsyncProfilingTaskList } from "@/types/async-profiling"; import { store } from "@/store"; import graphql from "@/graphql"; +import { useAppStoreWithOut } from "@/store/modules/app"; import type { AxiosResponse } from "axios"; +import type { Instance } from "@/types/selector"; interface AsyncProfilingState { taskList: Array>; labels: Option[]; asyncProfilingTips: string; selectedTask: Recordable; + taskProgress: Recordable; + instances: Instance[]; } export const asyncProfilingStore = defineStore({ @@ -35,6 +39,8 @@ export const asyncProfilingStore = defineStore({ labels: [{ value: "", label: "" }], asyncProfilingTips: "", selectedTask: {}, + taskProgress: {}, + instances: [], }), actions: { setSelectedTask(task: Recordable) { @@ -64,7 +70,21 @@ export const asyncProfilingStore = defineStore({ if (res.data.errors) { return res.data; } - this.taskLogs = res.data.data.taskLogs; + this.taskProgress = res.data.data.taskProgress; + return res.data; + }, + async getServiceInstances(param?: { serviceId: string; isRelation: boolean }): Promise> { + const serviceId = param ? param.serviceId : this.currentService?.id; + if (!serviceId) { + return null; + } + const res: AxiosResponse = await graphql.query("queryInstances").params({ + serviceId, + duration: useAppStoreWithOut().durationTime, + }); + if (!res.data.errors) { + this.instances = res.data.data.pods || []; + } return res.data; }, }, diff --git a/src/types/profile.d.ts b/src/types/profile.d.ts index ac7fb79f..254d1490 100644 --- a/src/types/profile.d.ts +++ b/src/types/profile.d.ts @@ -41,6 +41,8 @@ export interface TaskListItem { dumpPeriod: number; maxSamplingCount: number; logs: TaskLog[]; + errorInstanceIds: string[]; + successInstanceIds: string[]; } export interface SegmentSpan { spanId: string; diff --git a/src/views/dashboard/related/async-profiling/Content.vue b/src/views/dashboard/related/async-profiling/Content.vue index b188e42c..db79628e 100644 --- a/src/views/dashboard/related/async-profiling/Content.vue +++ b/src/views/dashboard/related/async-profiling/Content.vue @@ -19,9 +19,21 @@ limitations under the License. -->