mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-18 08:25:25 +00:00
create tasks
This commit is contained in:
parent
493ec4bec2
commit
3f1463068c
34
src/graphql/fragments/ebpf.ts
Normal file
34
src/graphql/fragments/ebpf.ts
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const queryCreateTaskData = {
|
||||||
|
variable: "$serviceId: ID!",
|
||||||
|
query: `
|
||||||
|
createTaskData: queryPrepareCreateEBPFProfilingTaskData(serviceId: $serviceId) {
|
||||||
|
couldProfiling
|
||||||
|
processLabels
|
||||||
|
}`,
|
||||||
|
};
|
||||||
|
export const createEBPFTask = {
|
||||||
|
variable: "$request: EBPFProfilingTaskFixedTimeCreationRequest!",
|
||||||
|
query: `
|
||||||
|
createTaskData: createEBPFProfilingFixedTimeTask(request: $request) {
|
||||||
|
status
|
||||||
|
errorReason
|
||||||
|
id
|
||||||
|
}`,
|
||||||
|
};
|
@ -25,6 +25,7 @@ import * as log from "./query/log";
|
|||||||
import * as profile from "./query/profile";
|
import * as profile from "./query/profile";
|
||||||
import * as alarm from "./query/alarm";
|
import * as alarm from "./query/alarm";
|
||||||
import * as event from "./query/event";
|
import * as event from "./query/event";
|
||||||
|
import * as ebpf from "./query/ebpf";
|
||||||
|
|
||||||
const query: { [key: string]: string } = {
|
const query: { [key: string]: string } = {
|
||||||
...app,
|
...app,
|
||||||
@ -36,6 +37,7 @@ const query: { [key: string]: string } = {
|
|||||||
...profile,
|
...profile,
|
||||||
...alarm,
|
...alarm,
|
||||||
...event,
|
...event,
|
||||||
|
...ebpf,
|
||||||
};
|
};
|
||||||
class Graphql {
|
class Graphql {
|
||||||
private queryData = "";
|
private queryData = "";
|
||||||
|
22
src/graphql/query/ebpf.ts
Normal file
22
src/graphql/query/ebpf.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
/**
|
||||||
|
* 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 { queryCreateTaskData, createEBPFTask } from "../fragments/ebpf";
|
||||||
|
|
||||||
|
export const getCreateTaskData = `query queryCreateTaskData(${queryCreateTaskData.variable}) {${queryCreateTaskData.query}}`;
|
||||||
|
|
||||||
|
export const saveEBPFTask = `mutation createEBPFTask(${createEBPFTask.variable}) {${createEBPFTask.query}}`;
|
@ -16,14 +16,13 @@
|
|||||||
*/
|
*/
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { Duration, Option } from "@/types/app";
|
import { Duration, Option } from "@/types/app";
|
||||||
import { Endpoint } from "@/types/selector";
|
|
||||||
import {
|
import {
|
||||||
TaskListItem,
|
TaskListItem,
|
||||||
SegmentSpan,
|
SegmentSpan,
|
||||||
ProfileAnalyzationTrees,
|
ProfileAnalyzationTrees,
|
||||||
TaskLog,
|
TaskLog,
|
||||||
ProfileTaskCreationRequest,
|
|
||||||
} from "@/types/profile";
|
} from "@/types/profile";
|
||||||
|
import { EBPFTaskCreationRequest } from "@/types/ebpf";
|
||||||
import { Trace, Span } from "@/types/trace";
|
import { Trace, Span } from "@/types/trace";
|
||||||
import { store } from "@/store";
|
import { store } from "@/store";
|
||||||
import graphql from "@/graphql";
|
import graphql from "@/graphql";
|
||||||
@ -31,8 +30,6 @@ import { AxiosResponse } from "axios";
|
|||||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||||
|
|
||||||
interface EbpfStore {
|
interface EbpfStore {
|
||||||
endpoints: Endpoint[];
|
|
||||||
taskEndpoints: Endpoint[];
|
|
||||||
durationTime: Duration;
|
durationTime: Duration;
|
||||||
condition: { serviceId: string; endpointName: string };
|
condition: { serviceId: string; endpointName: string };
|
||||||
taskList: TaskListItem[];
|
taskList: TaskListItem[];
|
||||||
@ -44,13 +41,12 @@ interface EbpfStore {
|
|||||||
taskLogs: TaskLog[];
|
taskLogs: TaskLog[];
|
||||||
highlightTop: boolean;
|
highlightTop: boolean;
|
||||||
labels: Option[];
|
labels: Option[];
|
||||||
|
couldProfiling: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ebpfStore = defineStore({
|
export const ebpfStore = defineStore({
|
||||||
id: "profile",
|
id: "eBPF",
|
||||||
state: (): EbpfStore => ({
|
state: (): EbpfStore => ({
|
||||||
endpoints: [{ value: "", label: "All" }],
|
|
||||||
taskEndpoints: [{ value: "", label: "All" }],
|
|
||||||
durationTime: useAppStoreWithOut().durationTime,
|
durationTime: useAppStoreWithOut().durationTime,
|
||||||
condition: { serviceId: "", endpointName: "" },
|
condition: { serviceId: "", endpointName: "" },
|
||||||
taskList: [],
|
taskList: [],
|
||||||
@ -62,6 +58,7 @@ export const ebpfStore = defineStore({
|
|||||||
taskLogs: [],
|
taskLogs: [],
|
||||||
highlightTop: true,
|
highlightTop: true,
|
||||||
labels: [{ value: "", label: "" }],
|
labels: [{ value: "", label: "" }],
|
||||||
|
couldProfiling: false,
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
setConditions(data: { serviceId?: string; endpointName?: string }) {
|
setConditions(data: { serviceId?: string; endpointName?: string }) {
|
||||||
@ -79,28 +76,19 @@ export const ebpfStore = defineStore({
|
|||||||
setHighlightTop() {
|
setHighlightTop() {
|
||||||
this.highlightTop = !this.highlightTop;
|
this.highlightTop = !this.highlightTop;
|
||||||
},
|
},
|
||||||
async getEndpoints(serviceId: string, keyword?: string) {
|
async getCreateTaskData(serviceId: string) {
|
||||||
const res: AxiosResponse = await graphql.query("queryEndpoints").params({
|
const res: AxiosResponse = await graphql
|
||||||
serviceId,
|
.query("getCreateTaskData")
|
||||||
duration: this.durationTime,
|
.params({ serviceId });
|
||||||
keyword: keyword || "",
|
|
||||||
});
|
|
||||||
if (res.data.errors) {
|
if (res.data.errors) {
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
this.endpoints = [{ value: "", label: "All" }, ...res.data.data.pods];
|
const json = res.data.data.createTaskData;
|
||||||
return res.data;
|
this.couldProfiling = json.couldProfiling || [];
|
||||||
},
|
this.labels = json.processLabels.map((d: string) => {
|
||||||
async getTaskEndpoints(serviceId: string, keyword?: string) {
|
return { label: d, value: d };
|
||||||
const res: AxiosResponse = await graphql.query("queryEndpoints").params({
|
|
||||||
serviceId,
|
|
||||||
duration: this.durationTime,
|
|
||||||
keyword: keyword || "",
|
|
||||||
});
|
});
|
||||||
if (res.data.errors) {
|
|
||||||
return res.data;
|
|
||||||
}
|
|
||||||
this.taskEndpoints = [{ value: "", label: "All" }, ...res.data.data.pods];
|
|
||||||
return res.data;
|
return res.data;
|
||||||
},
|
},
|
||||||
async getTaskList() {
|
async getTaskList() {
|
||||||
@ -197,15 +185,16 @@ export const ebpfStore = defineStore({
|
|||||||
this.analyzeTrees = analyze.trees;
|
this.analyzeTrees = analyze.trees;
|
||||||
return res.data;
|
return res.data;
|
||||||
},
|
},
|
||||||
async createTask(param: ProfileTaskCreationRequest) {
|
async createTask(param: EBPFTaskCreationRequest) {
|
||||||
const res: AxiosResponse = await graphql
|
const res: AxiosResponse = await graphql
|
||||||
.query("saveProfileTask")
|
.query("saveEBPFTask")
|
||||||
.params({ creationRequest: param });
|
.params({ request: param });
|
||||||
|
|
||||||
if (res.data.errors) {
|
if (res.data.errors) {
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
this.getTaskList();
|
console.log(res.data.data);
|
||||||
|
// this.getTaskList();
|
||||||
return res.data;
|
return res.data;
|
||||||
},
|
},
|
||||||
async getTaskLogs(param: { taskID: string }) {
|
async getTaskLogs(param: { taskID: string }) {
|
||||||
|
24
src/types/ebpf.d.ts
vendored
Normal file
24
src/types/ebpf.d.ts
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export interface EBPFTaskCreationRequest {
|
||||||
|
serviceId: string;
|
||||||
|
processLabels: string[];
|
||||||
|
startTime: number;
|
||||||
|
duration: number;
|
||||||
|
targetType: string;
|
||||||
|
}
|
@ -14,27 +14,6 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License. -->
|
limitations under the License. -->
|
||||||
<template>
|
<template>
|
||||||
<div class="flex-h header">
|
<div class="flex-h header">
|
||||||
<div class="mr-10">
|
|
||||||
<span class="grey mr-5">{{ t("endpointName") }}:</span>
|
|
||||||
<Selector
|
|
||||||
class="name"
|
|
||||||
size="small"
|
|
||||||
:value="endpointName"
|
|
||||||
:options="ebpfStore.endpoints"
|
|
||||||
placeholder="Select a endpoint"
|
|
||||||
:isRemote="true"
|
|
||||||
@change="changeEndpoint"
|
|
||||||
@query="searchEndpoints"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<el-button
|
|
||||||
class="search-btn"
|
|
||||||
size="small"
|
|
||||||
type="primary"
|
|
||||||
@click="searchTasks"
|
|
||||||
>
|
|
||||||
{{ t("search") }}
|
|
||||||
</el-button>
|
|
||||||
<el-button class="search-btn" size="small" @click="createTask">
|
<el-button class="search-btn" size="small" @click="createTask">
|
||||||
{{ t("newTask") }}
|
{{ t("newTask") }}
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -67,26 +46,7 @@ const { t } = useI18n();
|
|||||||
const endpointName = ref<string>("");
|
const endpointName = ref<string>("");
|
||||||
const newTask = ref<boolean>(false);
|
const newTask = ref<boolean>(false);
|
||||||
|
|
||||||
searchTasks();
|
// searchTasks();
|
||||||
searchEndpoints("");
|
|
||||||
|
|
||||||
async function searchEndpoints(keyword: string) {
|
|
||||||
if (!selectorStore.currentService) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const service = selectorStore.currentService.value;
|
|
||||||
const res = await ebpfStore.getEndpoints(service, keyword);
|
|
||||||
|
|
||||||
if (res.errors) {
|
|
||||||
ElMessage.error(res.errors);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
endpointName.value = ebpfStore.endpoints[0].value;
|
|
||||||
}
|
|
||||||
|
|
||||||
function changeEndpoint(opt: any[]) {
|
|
||||||
endpointName.value = opt[0].value;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function searchTasks() {
|
async function searchTasks() {
|
||||||
ebpfStore.setConditions({
|
ebpfStore.setConditions({
|
||||||
@ -101,8 +61,12 @@ async function searchTasks() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function createTask() {
|
async function createTask() {
|
||||||
|
if (!selectorStore.currentService) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
newTask.value = true;
|
newTask.value = true;
|
||||||
|
await ebpfStore.getCreateTaskData(selectorStore.currentService.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
@ -14,25 +14,35 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License. -->
|
limitations under the License. -->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="profile-task">
|
<div class="ebpf-task" v-if="eBPFStore.couldProfiling">
|
||||||
<div>
|
<div>
|
||||||
<div class="label">{{ t("endpointName") }}</div>
|
<div class="label">{{ t("labels") }}</div>
|
||||||
<Selector
|
<Selector
|
||||||
class="profile-input"
|
class="profile-input"
|
||||||
size="small"
|
size="small"
|
||||||
:value="endpointName"
|
:value="labels"
|
||||||
:options="eBPFStore.taskEndpoints"
|
:options="eBPFStore.labels"
|
||||||
placeholder="Select a endpoint"
|
placeholder="Select labels"
|
||||||
|
:multiple="true"
|
||||||
|
@change="changeLabel"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="label">{{ t("labels") }}</div>
|
||||||
|
<Selector
|
||||||
|
class="profile-input"
|
||||||
|
size="small"
|
||||||
|
:value="type"
|
||||||
|
:options="TargetTypes"
|
||||||
|
placeholder="Select a type"
|
||||||
:isRemote="true"
|
:isRemote="true"
|
||||||
@change="changeEndpoint"
|
@change="changeType"
|
||||||
@query="searchEndpoints"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="label">{{ t("monitorTime") }}</div>
|
<div class="label">{{ t("monitorTime") }}</div>
|
||||||
<div>
|
<div>
|
||||||
<Radio
|
<Radio
|
||||||
class="mb-5"
|
|
||||||
:value="monitorTime"
|
:value="monitorTime"
|
||||||
:options="InitTaskField.monitorTimeEn"
|
:options="InitTaskField.monitorTimeEn"
|
||||||
@change="changeMonitorTime"
|
@change="changeMonitorTime"
|
||||||
@ -49,40 +59,14 @@ limitations under the License. -->
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="label">{{ t("monitorDuration") }}</div>
|
<div class="label">{{ t("monitorDuration") }}</div>
|
||||||
<Radio
|
<el-input
|
||||||
class="mb-5"
|
|
||||||
:value="monitorDuration"
|
|
||||||
:options="InitTaskField.monitorDuration"
|
|
||||||
@change="changeMonitorDuration"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div class="label">{{ t("minThreshold") }} (ms)</div>
|
|
||||||
<el-input-number
|
|
||||||
size="small"
|
|
||||||
class="profile-input"
|
class="profile-input"
|
||||||
:min="0"
|
v-model="monitorDuration"
|
||||||
v-model="minThreshold"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div class="label">{{ t("dumpPeriod") }}</div>
|
|
||||||
<Radio
|
|
||||||
class="mb-5"
|
|
||||||
:value="dumpPeriod"
|
|
||||||
:options="InitTaskField.dumpPeriod"
|
|
||||||
@change="changeDumpPeriod"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div class="label">{{ t("maxSamplingCount") }}</div>
|
|
||||||
<Selector
|
|
||||||
size="small"
|
size="small"
|
||||||
:value="maxSamplingCount"
|
placeholder="none"
|
||||||
:options="InitTaskField.maxSamplingCount"
|
type="number"
|
||||||
placeholder="Select a data"
|
:min="1"
|
||||||
@change="changeMaxSamplingCount"
|
:max="60"
|
||||||
class="profile-input"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@ -91,6 +75,7 @@ limitations under the License. -->
|
|||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else>Don't have process could profiling</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
@ -99,67 +84,40 @@ import { useEbpfStore } from "@/store/modules/ebpf";
|
|||||||
import { useSelectorStore } from "@/store/modules/selectors";
|
import { useSelectorStore } from "@/store/modules/selectors";
|
||||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import { InitTaskField } from "./data";
|
import { InitTaskField, TargetTypes } from "./data";
|
||||||
/* global defineEmits */
|
/* global defineEmits */
|
||||||
const emits = defineEmits(["close"]);
|
const emits = defineEmits(["close"]);
|
||||||
const eBPFStore = useEbpfStore();
|
const eBPFStore = useEbpfStore();
|
||||||
const selectorStore = useSelectorStore();
|
const selectorStore = useSelectorStore();
|
||||||
const appStore = useAppStoreWithOut();
|
const appStore = useAppStoreWithOut();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const endpointName = ref<string>("");
|
const labels = ref<string[]>([]);
|
||||||
|
const type = ref<string>(TargetTypes[0].value);
|
||||||
const monitorTime = ref<string>(InitTaskField.monitorTimeEn[0].value);
|
const monitorTime = ref<string>(InitTaskField.monitorTimeEn[0].value);
|
||||||
const monitorDuration = ref<string>(InitTaskField.monitorDuration[0].value);
|
const monitorDuration = ref<number>(10);
|
||||||
const time = ref<Date>(appStore.durationRow.start);
|
const time = ref<Date>(appStore.durationRow.start);
|
||||||
const minThreshold = ref<number>(0);
|
|
||||||
const dumpPeriod = ref<string>(InitTaskField.dumpPeriod[0].value);
|
|
||||||
const maxSamplingCount = ref<string>(InitTaskField.maxSamplingCount[0].value);
|
|
||||||
|
|
||||||
async function searchEndpoints(keyword: string) {
|
|
||||||
if (!selectorStore.currentService) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const service = selectorStore.currentService.value;
|
|
||||||
const res = await eBPFStore.getEndpoints(service, keyword);
|
|
||||||
|
|
||||||
if (res.errors) {
|
|
||||||
ElMessage.error(res.errors);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
endpointName.value = eBPFStore.taskEndpoints[0].value;
|
|
||||||
}
|
|
||||||
|
|
||||||
function changeMonitorTime(opt: string) {
|
function changeMonitorTime(opt: string) {
|
||||||
monitorTime.value = opt;
|
monitorTime.value = opt;
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeMonitorDuration(val: string) {
|
function changeLabel(opt: any[]) {
|
||||||
monitorDuration.value = val;
|
labels.value = opt.map((d) => d.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeDumpPeriod(val: string) {
|
function changeType(opt: any[]) {
|
||||||
dumpPeriod.value = val;
|
type.value = opt[0].value;
|
||||||
}
|
|
||||||
|
|
||||||
function changeMaxSamplingCount(opt: any[]) {
|
|
||||||
maxSamplingCount.value = opt[0].value;
|
|
||||||
}
|
|
||||||
|
|
||||||
function changeEndpoint(opt: any[]) {
|
|
||||||
endpointName.value = opt[0].value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function createTask() {
|
async function createTask() {
|
||||||
emits("close");
|
|
||||||
const date =
|
const date =
|
||||||
monitorTime.value === "0" ? appStore.durationRow.start : time.value;
|
monitorTime.value === "0" ? appStore.durationRow.start : time.value;
|
||||||
const params = {
|
const params = {
|
||||||
serviceId: selectorStore.currentService.id,
|
serviceId: selectorStore.currentService.id,
|
||||||
endpointName: endpointName.value,
|
processLabels: labels.value,
|
||||||
startTime: date.getTime(),
|
startTime: date.getTime(),
|
||||||
duration: Number(monitorDuration.value),
|
duration: monitorDuration.value * 60,
|
||||||
minDurationThreshold: Number(minThreshold.value),
|
targetType: "ON_CPU",
|
||||||
dumpPeriod: Number(dumpPeriod.value),
|
|
||||||
maxSamplingCount: Number(maxSamplingCount.value),
|
|
||||||
};
|
};
|
||||||
const res = await eBPFStore.createTask(params);
|
const res = await eBPFStore.createTask(params);
|
||||||
if (res.errors) {
|
if (res.errors) {
|
||||||
@ -172,13 +130,14 @@ async function createTask() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ElMessage.success("Task created successfully");
|
ElMessage.success("Task created successfully");
|
||||||
|
emits("close");
|
||||||
}
|
}
|
||||||
function changeTimeRange(val: Date) {
|
function changeTimeRange(val: Date) {
|
||||||
time.value = val;
|
time.value = val;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.profile-task {
|
.ebpf-task {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
width: 400px;
|
width: 400px;
|
||||||
}
|
}
|
||||||
|
@ -28,8 +28,9 @@ export const NewTaskField = {
|
|||||||
maxSamplingCount: { key: 5, label: "5" },
|
maxSamplingCount: { key: 5, label: "5" },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const TargetTypes = [{ label: "ON_CPU", value: "ON_CPU" }];
|
||||||
|
|
||||||
export const InitTaskField = {
|
export const InitTaskField = {
|
||||||
serviceSource: [{ key: "", label: "None" }],
|
|
||||||
monitorTimeEn: [
|
monitorTimeEn: [
|
||||||
{ value: "0", label: "monitor now" },
|
{ value: "0", label: "monitor now" },
|
||||||
{ value: "1", label: "set start time" },
|
{ value: "1", label: "set start time" },
|
||||||
@ -43,21 +44,4 @@ export const InitTaskField = {
|
|||||||
{ value: "10", label: "10 min" },
|
{ value: "10", label: "10 min" },
|
||||||
{ value: "15", label: "15 min" },
|
{ value: "15", label: "15 min" },
|
||||||
],
|
],
|
||||||
dumpPeriod: [
|
|
||||||
{ value: "10", label: "10 ms" },
|
|
||||||
{ value: "20", label: "20 ms" },
|
|
||||||
{ value: "50", label: "50 ms" },
|
|
||||||
{ value: "100", label: "100 ms" },
|
|
||||||
],
|
|
||||||
maxSamplingCount: [
|
|
||||||
{ value: "1", label: "1" },
|
|
||||||
{ value: "2", label: "2" },
|
|
||||||
{ value: "3", label: "3" },
|
|
||||||
{ value: "4", label: "4" },
|
|
||||||
{ value: "5", label: "5" },
|
|
||||||
{ value: "6", label: "6" },
|
|
||||||
{ value: "7", label: "7" },
|
|
||||||
{ value: "8", label: "8" },
|
|
||||||
{ value: "9", label: "9" },
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user