diff --git a/src/entities/profiler/types.ts b/src/entities/profiler/types.ts index f8b4cfa2..7424bf37 100644 --- a/src/entities/profiler/types.ts +++ b/src/entities/profiler/types.ts @@ -1,3 +1,5 @@ +import {GraphTypes, type Uuid} from "~/src/shared/types"; + export interface ProfilerCost { d_cpu: number; d_wt: number; @@ -14,14 +16,6 @@ export interface ProfilerCost { p_wt: number; } -export interface ProfilerEdge { - id: string, - parent: string | null, - caller: string | null, - callee: string, - cost: ProfilerCost -} - export interface Profiler { tags: { [key: string]: string | null | number @@ -31,3 +25,38 @@ export interface Profiler { date: number, peaks: ProfilerCost, } + +export type TCallGraphEdge = { + data: { + color: string + label: string + source: string + target: string + } +} + +export type TCallGraphNode = { + data: { + id: Uuid + color: string, + cost: Partial + metrics: Partial + name: string + textColor: string + } +} + +export type TCallGraph = { + edges: TCallGraphEdge[], + nodes: TCallGraphNode[], + toolbar: { label: string; metric: GraphTypes; description: string }[], +} + + +export interface TCallGraphBoard { + edge: { + callee: string, + caller: string, + cost: Partial, + } +} diff --git a/src/screens/profiler/types.ts b/src/screens/profiler/types.ts deleted file mode 100644 index 9380eb46..00000000 --- a/src/screens/profiler/types.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ProfilerEdge } from "~/src/entities/profiler/types"; - -export type CallStackHoverData = ProfilerEdge & { position: { x: number; y: number } } diff --git a/src/screens/profiler/ui/call-graph-toolbar/call-graph-toolbar.vue b/src/screens/profiler/ui/call-graph-toolbar/call-graph-toolbar.vue index a979328e..7530f213 100644 --- a/src/screens/profiler/ui/call-graph-toolbar/call-graph-toolbar.vue +++ b/src/screens/profiler/ui/call-graph-toolbar/call-graph-toolbar.vue @@ -1,13 +1,14 @@ @@ -91,7 +95,7 @@ const handleChangeMetric = (event: Event) => { :min="metric === GraphTypes.CALLS ? 1 : 0" :max="metric === GraphTypes.CALLS ? 1000 : 100" :step="metric === GraphTypes.CALLS ? 10 : 5" - @input="handleChangeMetric" + @input="handlePercent" > diff --git a/src/screens/profiler/ui/call-graph/call-graph.vue b/src/screens/profiler/ui/call-graph/call-graph.vue index fd6499e9..362e0f27 100644 --- a/src/screens/profiler/ui/call-graph/call-graph.vue +++ b/src/screens/profiler/ui/call-graph/call-graph.vue @@ -1,9 +1,9 @@