This commit is contained in:
Fine 2024-11-26 16:13:54 +08:00
parent a828e1b016
commit b6d8a2c160
4 changed files with 22 additions and 24 deletions

View File

@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License. -->
<template>
<div class="profile-wrapper flex-v">
<div class="title">Async Profiling</div>
<el-popover placement="bottom" trigger="click" :width="100" v-if="dashboardStore.editMode">
<template #reference>
<span class="operation cp">
@ -84,11 +83,4 @@ limitations under the License. -->
background-color: $popper-hover-bg-color;
}
}
.title {
font-weight: bold;
line-height: 40px;
padding: 0 10px;
border-bottom: 1px solid $border-color;
}
</style>

View File

@ -14,20 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License. -->
<template>
<div class="flex-h header">
<el-input
v-model="keywords"
style="width: 240px"
placeholder="Please input create time to search"
@change="searchTasks()"
size="small"
>
<template #append>
<el-button size="small">
<Icon size="sm" iconName="search" />
</el-button>
</template>
</el-input>
<el-button class="search-btn ml-10" size="small" @click="createTask">
<div class="title">Async Profiling</div>
<el-button class="new-btn ml-10" size="small" @click="createTask">
{{ t("newTask") }}
</el-button>
</div>
@ -55,7 +43,6 @@ limitations under the License. -->
const selectorStore = useSelectorStore();
const dashboardStore = useDashboardStore();
const { t } = useI18n();
const keywords = ref<string>("");
const newTask = ref<boolean>(false);
if (props.needQuery) {
@ -100,4 +87,13 @@ limitations under the License. -->
.name {
width: 270px;
}
.new-btn {
float: right;
}
.title {
font-weight: bold;
line-height: 24px;
}
</style>

View File

@ -43,6 +43,7 @@ limitations under the License. -->
import { useAsyncProfilingStore } from "@/store/modules/async-profiling";
import type { Instance } from "@/types/selector";
import type { Option } from "@/types/app";
import { EventsMap } from "./data";
const { t } = useI18n();
const asyncProfilingStore = useAsyncProfilingStore();
@ -69,7 +70,7 @@ limitations under the License. -->
const res = await asyncProfilingStore.getAsyncProfilingAnalyze({
instanceIds: serviceInstanceIds.value,
taskId: asyncProfilingStore.selectedTask.id,
eventType: selectedEventType.value,
eventType: (EventsMap as any)[selectedEventType.value],
});
if (res.data && res.data.errors) {
ElMessage.error(res.data.errors);

View File

@ -25,3 +25,12 @@ export const ProfilingEvents = [
{ value: "CPU", label: "CPU" },
{ value: "ALLOC", label: "ALLOC" },
];
export enum EventsMap {
CPU = "EXECUTION_SAMPLE",
WALL = "EXECUTION_SAMPLE",
CTIMER = "EXECUTION_SAMPLE",
ITIMER = "EXECUTION_SAMPLE",
LOCK = "JAVA_MONITOR_ENTER",
ALLOC = "OBJECT_ALLOCATION_OUTSIDE_TLAB",
}