From 0a91bcf2876a26cc6858ea22fa053711f2b56758 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Thu, 5 Dec 2024 16:18:35 -0500 Subject: [PATCH] Cleanup vega descriptions for workflow metrics. It isn't exposed explictly but seeing this text when opening the Vega source or using the Vega editor from the link on the widget was a little offputting. I thought maybe the data was random at first but the jitter is only added in the x direction for reasons that make sense once you think about but isn't something I think should be forefronted. --- .../WorkflowInvocationMetrics.vue | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/client/src/components/WorkflowInvocationState/WorkflowInvocationMetrics.vue b/client/src/components/WorkflowInvocationState/WorkflowInvocationMetrics.vue index 91782651b709..cc13d80658cd 100644 --- a/client/src/components/WorkflowInvocationState/WorkflowInvocationMetrics.vue +++ b/client/src/components/WorkflowInvocationState/WorkflowInvocationMetrics.vue @@ -55,12 +55,14 @@ interface boxplotData { x_title: string; y_title: string; values?: { x: string; y: Number }[]; + description: string; } function metricToSpecData( jobMetrics: components["schemas"]["WorkflowJobMetric"][] | undefined, metricName: string, yTitle: string, + description: string, transform?: (param: number) => number ) { const wallclock = jobMetrics?.filter((jobMetric) => jobMetric.name == metricName); @@ -78,29 +80,41 @@ function metricToSpecData( x_title: attributeToLabel[groupBy.value], y_title: yTitle, values, + description, }; } const wallclock: ComputedRef = computed(() => { - return metricToSpecData(jobMetrics.value, "runtime_seconds", "Runtime (in Seconds)"); + return metricToSpecData(jobMetrics.value, "runtime_seconds", "Runtime (in Seconds)", "Boxplot of runtime"); }); const coresAllocated: ComputedRef = computed(() => { - return metricToSpecData(jobMetrics.value, "galaxy_slots", "Cores Allocated"); + return metricToSpecData(jobMetrics.value, "galaxy_slots", "Cores Allocated", "Boxplot of cores allocated"); }); const memoryAllocated: ComputedRef = computed(() => { - return metricToSpecData(jobMetrics.value, "galaxy_memory_mb", "Memory Allocated (in MB)"); + return metricToSpecData( + jobMetrics.value, + "galaxy_memory_mb", + "Memory Allocated (in MB)", + "Boxplot of memory allocated" + ); }); const peakMemory: ComputedRef = computed(() => { - return metricToSpecData(jobMetrics.value, "memory.peak", "Max memory usage recorded (in MB)", (v) => v / 1024 ** 2); + return metricToSpecData( + jobMetrics.value, + "memory.peak", + "Max memory usage recorded (in MB)", + "Boxplot of peak memory consumed", + (v) => v / 1024 ** 2 + ); }); function itemToSpec(item: boxplotData) { const spec: VisualizationSpec = { $schema: "https://vega.github.io/schema/vega-lite/v5.json", - description: "A boxplot with jittered points.", + description: item.description, data: { values: item.values!, },