From 369b3feb355824536ee73bff3bd4eeed291f9f9c Mon Sep 17 00:00:00 2001 From: Jacob Shandling <61553566+jacobshandling@users.noreply.github.com> Date: Mon, 18 Dec 2023 09:36:47 -0800 Subject: [PATCH] UI - Update host-specific performance impact calculations (#15706) ## Fixes an existing bug in calculating performance impact for host-specifc query stats --------- Co-authored-by: Jacob Shandling Co-authored-by: Sarah Gillespie <73313222+gillespi314@users.noreply.github.com> --- .../hosts/details/cards/Queries/HostQueriesTableConfig.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/pages/hosts/details/cards/Queries/HostQueriesTableConfig.tsx b/frontend/pages/hosts/details/cards/Queries/HostQueriesTableConfig.tsx index 0332338ab..18684dbff 100644 --- a/frontend/pages/hosts/details/cards/Queries/HostQueriesTableConfig.tsx +++ b/frontend/pages/hosts/details/cards/Queries/HostQueriesTableConfig.tsx @@ -136,9 +136,11 @@ const enhanceScheduleData = ( discard_data, automations_enabled, } = query; + // getPerformanceImpactDescription takes aggregate p50 values + // getPerformanceImpactDescription takes aggregate p50 values so we need to divide by total executions in order to show average performance per query execution const scheduledQueryPerformance = { - user_time_p50: user_time, - system_time_p50: system_time, + user_time_p50: executions > 0 ? user_time / executions : 0, + system_time_p50: executions > 0 ? system_time / executions : 0, total_executions: executions, }; return {