diff --git a/src/components/JitDetails.vue b/src/components/JitDetails.vue new file mode 100644 index 00000000..1b8169ce --- /dev/null +++ b/src/components/JitDetails.vue @@ -0,0 +1,34 @@ + + + diff --git a/src/components/PlanStats.vue b/src/components/PlanStats.vue index bcaac178..109736d6 100644 --- a/src/components/PlanStats.vue +++ b/src/components/PlanStats.vue @@ -9,6 +9,7 @@ import { duration, durationClass } from "@/filters" import { directive as vTippy } from "vue-tippy" import { NodeProp } from "../enums" import { formatNodeProp } from "@/filters" +import JitDetails from "@/components/JitDetails.vue" import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome" import { faCaretDown, faInfoCircle } from "@fortawesome/free-solid-svg-icons" @@ -18,6 +19,7 @@ const getHelpMessage = helpService.getHelpMessage const plan = inject(PlanKey) as Ref const showSettings = ref(false) const showTriggers = ref(false) +const showJitDetails = ref(false) const rootNode = computed(() => plan.value && plan.value.content.Plan) const planningTimeClass = (percent: number) => { @@ -135,7 +137,7 @@ function averageIO(node: Node) {
JIT: @@ -149,6 +151,23 @@ function averageIO(node: Node) { " v-html="duration(plan.planStats.jitTime)" > + +
+
+ +
+
diff --git a/src/enums.ts b/src/enums.ts index 3168a382..f20c382b 100644 --- a/src/enums.ts +++ b/src/enums.ts @@ -135,6 +135,7 @@ export enum NodeProp { ARRAY_INDEX_KEY = "arrayIndex", PEV_PLAN_TAG = "plan_", + JIT = "JIT", } export enum PropType { @@ -153,6 +154,7 @@ export enum PropType { rows, sortGroups, transferRate, + jit, } export const nodePropTypes: { [key: string]: PropType } = {} @@ -210,6 +212,8 @@ nodePropTypes[NodeProp.EXCLUSIVE_LOCAL_WRITTEN_BLOCKS] = PropType.blocks nodePropTypes[NodeProp.FULL_SORT_GROUPS] = PropType.sortGroups nodePropTypes[NodeProp.PRE_SORTED_GROUPS] = PropType.sortGroups +nodePropTypes[NodeProp.JIT] = PropType.jit + export class WorkerProp { // plan property keys public static WORKER_NUMBER = "Worker Number" diff --git a/src/filters.ts b/src/filters.ts index f07edf3e..8dae739f 100644 --- a/src/filters.ts +++ b/src/filters.ts @@ -1,7 +1,9 @@ import _ from "lodash" import { createApp } from "vue" import { EstimateDirection, nodePropTypes, PropType } from "@/enums" +import type { JIT } from "@/interfaces" import SortGroup from "@/components/SortGroup.vue" +import JitDetails from "@/components/JitDetails.vue" import hljs from "highlight.js/lib/core" import pgsql from "highlight.js/lib/languages/pgsql" hljs.registerLanguage("pgsql", pgsql) @@ -170,6 +172,13 @@ export function transferRate(value: number): string { return formatBytes(value * 8 * 1024) + "/s" } +function jit(value: JIT): string { + const app = createApp(JitDetails, { jit: value }).mount( + document.createElement("div") + ) + return app.$el.outerHTML +} + export function formatNodeProp(key: string, value: unknown): string { if (_.has(nodePropTypes, key)) { if (nodePropTypes[key] === PropType.duration) { @@ -207,6 +216,8 @@ export function formatNodeProp(key: string, value: unknown): string { return sortGroups(value as string) } else if (nodePropTypes[key] === PropType.transferRate) { return transferRate(value as number) + } else if (nodePropTypes[key] === PropType.jit) { + return jit(value as JIT) } } return _.escape(value as unknown as string)