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 <jacob@fleetdm.com>
Co-authored-by: Sarah Gillespie <73313222+gillespi314@users.noreply.github.com>
This commit is contained in:
Jacob Shandling 2023-12-18 09:36:47 -08:00 committed by GitHub
parent bfd54b8868
commit 369b3feb35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -136,9 +136,11 @@ const enhanceScheduleData = (
discard_data, discard_data,
automations_enabled, automations_enabled,
} = query; } = 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 = { const scheduledQueryPerformance = {
user_time_p50: user_time, user_time_p50: executions > 0 ? user_time / executions : 0,
system_time_p50: system_time, system_time_p50: executions > 0 ? system_time / executions : 0,
total_executions: executions, total_executions: executions,
}; };
return { return {