diff --git a/src/views/dashboard/related/async-profiling/Content.vue b/src/views/dashboard/related/async-profiling/Content.vue index f8fb9f0a..a0e8b079 100644 --- a/src/views/dashboard/related/async-profiling/Content.vue +++ b/src/views/dashboard/related/async-profiling/Content.vue @@ -33,7 +33,7 @@ limitations under the License. --> import TaskList from "./components/TaskList.vue"; import Filter from "./components/Filter.vue"; import EBPFStack from "@/views/dashboard/related/ebpf/components/EBPFStack.vue"; - import { ComponentType } from "@/views/dashboard/related/ebpf/components/data"; + import { ComponentType } from "./components/data"; const asyncProfilingStore = useAsyncProfilingStore(); const selectorStore = useSelectorStore(); diff --git a/src/views/dashboard/related/async-profiling/components/data.ts b/src/views/dashboard/related/async-profiling/components/data.ts index a91ccf7d..6c122f7b 100644 --- a/src/views/dashboard/related/async-profiling/components/data.ts +++ b/src/views/dashboard/related/async-profiling/components/data.ts @@ -38,3 +38,14 @@ export enum EventsMap { LOCK = "JAVA_MONITOR_ENTER", ALLOC = "OBJECT_ALLOCATION_OUTSIDE_TLAB", } + +export enum JFREventType { + EXECUTION_SAMPLE = "EXECUTION_SAMPLE", + JAVA_MONITOR_ENTER = "JAVA_MONITOR_ENTER", + THREAD_PARK = "THREAD_PARK", + OBJECT_ALLOCATION_IN_NEW_TLAB = "OBJECT_ALLOCATION_IN_NEW_TLAB", + OBJECT_ALLOCATION_OUTSIDE_TLAB = "OBJECT_ALLOCATION_OUTSIDE_TLAB", + PROFILER_LIVE_OBJECT = "PROFILER_LIVE_OBJECT", +} + +export const ComponentType = "ASYNC_PROFILING"; diff --git a/src/views/dashboard/related/ebpf/components/EBPFStack.vue b/src/views/dashboard/related/ebpf/components/EBPFStack.vue index aa95f80a..3e73e97f 100644 --- a/src/views/dashboard/related/ebpf/components/EBPFStack.vue +++ b/src/views/dashboard/related/ebpf/components/EBPFStack.vue @@ -25,7 +25,8 @@ limitations under the License. --> import { useEbpfStore } from "@/store/modules/ebpf"; import { useAsyncProfilingStore } from "@/store/modules/async-profiling"; import type { StackElement } from "@/types/ebpf"; - import { AggregateTypes, ComponentType } from "./data"; + import { AggregateTypes } from "./data"; + import { JFREventType, ComponentType } from "@/views/dashboard/related/async-profiling/components/data"; import "d3-flame-graph/dist/d3-flamegraph.css"; import { treeForeach } from "@/utils/flameGraph"; @@ -101,10 +102,7 @@ limitations under the License. --> .direction("s") .html((d: { data: StackElement } & { parent: { data: StackElement } }) => { const name = d.data.name.replace("<", "<").replace(">", ">"); - const valStr = - ebpfStore.aggregateType === AggregateTypes[0].value - ? `
Dump Count: ${d.data.dumpCount}
` - : `
Duration: ${d.data.dumpCount} ns
`; + const valStr = tooltipContent(d.data); const rateOfParent = (d.parent && `
Percentage Of Selected: ${ @@ -124,6 +122,26 @@ limitations under the License. --> d3.select("#graph-stack").datum(stackTree.value).call(flameChart.value); } + function tooltipContent(item: StackElement) { + if (props.type === ComponentType) { + if (!ebpfStore.analyzeTrees.length) { + return; + } + const { type } = ebpfStore.analyzeTrees[0]; + if ([JFREventType.JAVA_MONITOR_ENTER, JFREventType.THREAD_PARK].includes(type)) { + return `
Duration: ${item.dumpCount} ms
`; + } + if (type === JFREventType.EXECUTION_SAMPLE) { + return `
Count: ${item.dumpCount}
`; + } + return `
Memory: ${item.dumpCount} byte
`; + } + + ebpfStore.aggregateType === AggregateTypes[0].value + ? `
Dump Count: ${item.dumpCount}
` + : `
Duration: ${item.dumpCount} ns
`; + } + function countRange() { const list = []; for (const tree of ebpfStore.analyzeTrees) { diff --git a/src/views/dashboard/related/ebpf/components/data.ts b/src/views/dashboard/related/ebpf/components/data.ts index d41c8208..1ebc5f4c 100644 --- a/src/views/dashboard/related/ebpf/components/data.ts +++ b/src/views/dashboard/related/ebpf/components/data.ts @@ -57,5 +57,3 @@ export const TableHeader = [ { property: "name", label: "Name" }, { property: "instanceName", label: "Instance Name" }, ]; - -export const ComponentType = "ASYNC_PROFILING";