mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-23 21:35:23 +00:00
feat: update tasks query
This commit is contained in:
parent
b8ad72e1cc
commit
2c38d9c1f8
@ -33,9 +33,10 @@ export const createEBPFTask = {
|
|||||||
}`,
|
}`,
|
||||||
};
|
};
|
||||||
export const queryEBPFTasks = {
|
export const queryEBPFTasks = {
|
||||||
variable: "$serviceId: ID, $serviceInstanceId: ID, $targets: [EBPFProfilingTargetType!]",
|
variable:
|
||||||
|
"$serviceId: ID, $serviceInstanceId: ID, $targets: [EBPFProfilingTargetType!], triggerType: EBPFProfilingTriggerType",
|
||||||
query: `
|
query: `
|
||||||
queryEBPFTasks: queryEBPFProfilingTasks(serviceId: $serviceId, serviceInstanceId: $serviceInstanceId, targets: $targets) {
|
queryEBPFTasks: queryEBPFProfilingTasks(serviceId: $serviceId, serviceInstanceId: $serviceInstanceId, targets: $targets, triggerType: $triggerType) {
|
||||||
taskId
|
taskId
|
||||||
serviceName
|
serviceName
|
||||||
serviceId
|
serviceId
|
||||||
|
@ -48,3 +48,9 @@ export const ControlsTypes = [
|
|||||||
"ThirdPartyApp",
|
"ThirdPartyApp",
|
||||||
"ContinuousProfiling",
|
"ContinuousProfiling",
|
||||||
];
|
];
|
||||||
|
export enum EBPFProfilingTriggerType {
|
||||||
|
// Appoint the task executing total duration
|
||||||
|
FIXED_TIME,
|
||||||
|
// Trigger by the reach the continuous profiling policy
|
||||||
|
CONTINUOUS_PROFILING,
|
||||||
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import type { StrategyItem, CheckItems } from "@/types/continous-profiling";
|
import type { StrategyItem, CheckItems } from "@/types/continous-profiling";
|
||||||
import type { ProcessNode } from "@/types/ebpf";
|
import type { ProcessNode, EBPFTaskList } from "@/types/ebpf";
|
||||||
import { store } from "@/store";
|
import { store } from "@/store";
|
||||||
import graphql from "@/graphql";
|
import graphql from "@/graphql";
|
||||||
import type { AxiosResponse } from "axios";
|
import type { AxiosResponse } from "axios";
|
||||||
@ -26,7 +26,10 @@ import type { DurationTime } from "@/types/app";
|
|||||||
|
|
||||||
interface ContinousProfilingState {
|
interface ContinousProfilingState {
|
||||||
strategyList: Array<Recordable<StrategyItem>>;
|
strategyList: Array<Recordable<StrategyItem>>;
|
||||||
selectedStrategyTask: Recordable<StrategyItem>;
|
selectedStrategy: Recordable<StrategyItem>;
|
||||||
|
taskList: Array<Recordable<EBPFTaskList>>;
|
||||||
|
selectedContinousTask: Recordable<EBPFTaskList>;
|
||||||
|
errorTip: string;
|
||||||
errorReason: string;
|
errorReason: string;
|
||||||
nodes: ProcessNode[];
|
nodes: ProcessNode[];
|
||||||
calls: Call[];
|
calls: Call[];
|
||||||
@ -43,8 +46,11 @@ export const continousProfilingStore = defineStore({
|
|||||||
id: "continousProfiling",
|
id: "continousProfiling",
|
||||||
state: (): ContinousProfilingState => ({
|
state: (): ContinousProfilingState => ({
|
||||||
strategyList: [],
|
strategyList: [],
|
||||||
selectedStrategyTask: {},
|
selectedStrategy: {},
|
||||||
|
taskList: [],
|
||||||
|
selectedContinousTask: {},
|
||||||
errorReason: "",
|
errorReason: "",
|
||||||
|
errorTip: "",
|
||||||
nodes: [],
|
nodes: [],
|
||||||
calls: [],
|
calls: [],
|
||||||
node: null,
|
node: null,
|
||||||
@ -56,8 +62,11 @@ export const continousProfilingStore = defineStore({
|
|||||||
loadNodes: false,
|
loadNodes: false,
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
setSelectedStrategyTask(task: Recordable<StrategyItem>) {
|
setSelectedStrategy(task: Recordable<StrategyItem>) {
|
||||||
this.selectedStrategyTask = task || {};
|
this.selectedStrategy = task || {};
|
||||||
|
},
|
||||||
|
setSelectedContinousTask(task: Recordable<EBPFTaskList>) {
|
||||||
|
this.selectedContinousTask = task || {};
|
||||||
},
|
},
|
||||||
setNode(node: Nullable<ProcessNode>) {
|
setNode(node: Nullable<ProcessNode>) {
|
||||||
this.node = node;
|
this.node = node;
|
||||||
@ -146,13 +155,37 @@ export const continousProfilingStore = defineStore({
|
|||||||
id: index,
|
id: index,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
this.setSelectedStrategyTask(this.strategyList[0] || {});
|
this.setSelectedStrategy(this.strategyList[0] || {});
|
||||||
if (!this.strategyList.length) {
|
if (!this.strategyList.length) {
|
||||||
this.nodes = [];
|
this.nodes = [];
|
||||||
this.calls = [];
|
this.calls = [];
|
||||||
}
|
}
|
||||||
return res.data;
|
return res.data;
|
||||||
},
|
},
|
||||||
|
async getContinousTaskList(params: {
|
||||||
|
serviceId: string;
|
||||||
|
serviceInstanceId: string;
|
||||||
|
targets: string[];
|
||||||
|
triggerType: string;
|
||||||
|
}) {
|
||||||
|
if (!params.serviceId) {
|
||||||
|
return new Promise((resolve) => resolve({}));
|
||||||
|
}
|
||||||
|
const res: AxiosResponse = await graphql.query("getEBPFTasks").params(params);
|
||||||
|
|
||||||
|
this.errorTip = "";
|
||||||
|
if (res.data.errors) {
|
||||||
|
return res.data;
|
||||||
|
}
|
||||||
|
this.taskList = res.data.data.queryEBPFTasks || [];
|
||||||
|
this.selectedContinousTask = this.taskList[0] || {};
|
||||||
|
this.setSelectedContinousTask(this.selectedContinousTask);
|
||||||
|
if (!this.taskList.length) {
|
||||||
|
this.nodes = [];
|
||||||
|
this.calls = [];
|
||||||
|
}
|
||||||
|
return res.data;
|
||||||
|
},
|
||||||
async getProcessTopology(params: { duration: DurationTime; serviceInstanceId: string }) {
|
async getProcessTopology(params: { duration: DurationTime; serviceInstanceId: string }) {
|
||||||
this.loadNodes = true;
|
this.loadNodes = true;
|
||||||
const res: AxiosResponse = await graphql.query("getProcessTopology").params(params);
|
const res: AxiosResponse = await graphql.query("getProcessTopology").params(params);
|
||||||
|
@ -20,6 +20,7 @@ import type { EBPFTaskCreationRequest, EBPFProfilingSchedule, EBPFTaskList, Anal
|
|||||||
import { store } from "@/store";
|
import { store } from "@/store";
|
||||||
import graphql from "@/graphql";
|
import graphql from "@/graphql";
|
||||||
import type { AxiosResponse } from "axios";
|
import type { AxiosResponse } from "axios";
|
||||||
|
import { EBPFProfilingTriggerType } from "../data";
|
||||||
interface EbpfState {
|
interface EbpfState {
|
||||||
taskList: Array<Recordable<EBPFTaskList>>;
|
taskList: Array<Recordable<EBPFTaskList>>;
|
||||||
eBPFSchedules: EBPFProfilingSchedule[];
|
eBPFSchedules: EBPFProfilingSchedule[];
|
||||||
@ -77,6 +78,7 @@ export const ebpfStore = defineStore({
|
|||||||
this.getTaskList({
|
this.getTaskList({
|
||||||
serviceId: param.serviceId,
|
serviceId: param.serviceId,
|
||||||
targets: ["ON_CPU", "OFF_CPU"],
|
targets: ["ON_CPU", "OFF_CPU"],
|
||||||
|
triggerType: EBPFProfilingTriggerType.FIXED_TIME,
|
||||||
});
|
});
|
||||||
return res.data;
|
return res.data;
|
||||||
},
|
},
|
||||||
|
@ -35,7 +35,7 @@ limitations under the License. -->
|
|||||||
<td
|
<td
|
||||||
class="profile-td"
|
class="profile-td"
|
||||||
:class="{
|
:class="{
|
||||||
selected: continousProfilingStore.selectedStrategyTask.id === i.id,
|
selected: continousProfilingStore.selectedStrategy.id === i.id,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<div class="ell">
|
<div class="ell">
|
||||||
@ -84,7 +84,7 @@ limitations under the License. -->
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function changePolicy(item: StrategyItem) {
|
async function changePolicy(item: StrategyItem) {
|
||||||
continousProfilingStore.setSelectedStrategyTask(item);
|
continousProfilingStore.setSelectedStrategy(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
function setStrategies() {
|
function setStrategies() {
|
||||||
|
@ -33,6 +33,7 @@ limitations under the License. -->
|
|||||||
import { useDashboardStore } from "@/store/modules/dashboard";
|
import { useDashboardStore } from "@/store/modules/dashboard";
|
||||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||||
import { EntityType } from "../../data";
|
import { EntityType } from "../../data";
|
||||||
|
import { EBPFProfilingTriggerType } from "@/store/data";
|
||||||
|
|
||||||
/*global defineProps */
|
/*global defineProps */
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -54,6 +55,7 @@ limitations under the License. -->
|
|||||||
const res = await ebpfStore.getTaskList({
|
const res = await ebpfStore.getTaskList({
|
||||||
serviceId,
|
serviceId,
|
||||||
targets: ["ON_CPU", "OFF_CPU"],
|
targets: ["ON_CPU", "OFF_CPU"],
|
||||||
|
triggerType: EBPFProfilingTriggerType.FIXED_TIME,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res.errors) {
|
if (res.errors) {
|
||||||
|
@ -77,6 +77,7 @@ limitations under the License. -->
|
|||||||
import getLocalTime from "@/utils/localtime";
|
import getLocalTime from "@/utils/localtime";
|
||||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||||
import NewTask from "./NewTask.vue";
|
import NewTask from "./NewTask.vue";
|
||||||
|
import { EBPFProfilingTriggerType } from "@/store/data";
|
||||||
|
|
||||||
/*global Nullable */
|
/*global Nullable */
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
@ -185,6 +186,7 @@ limitations under the License. -->
|
|||||||
serviceId,
|
serviceId,
|
||||||
serviceInstanceId,
|
serviceInstanceId,
|
||||||
targets: ["NETWORK"],
|
targets: ["NETWORK"],
|
||||||
|
triggerType: EBPFProfilingTriggerType.FIXED_TIME,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res.errors) {
|
if (res.errors) {
|
||||||
|
Loading…
Reference in New Issue
Block a user