[AAP-103749] perf: vectorize JobHostSummaryAnonymizedRollup host outcome counts #657
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 267 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.334
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #657"
general
weight: 0.35
redhat-chai-bot
Description
metrics_utility/anonymized_rollups/jobhostsummary_anonymized_rollup.py):_aggregate_by_job_remote_id()and_aggregate_by_job_type_directly()countedsuccessful,failed, andunreachablehosts via three per-group Python lambdas (lambda x: (x == '...').sum()), forcing pandas into pure-Python Series slicing for every job group.int80/1 flag columns (is_successful,is_failed,is_unreachable) fromhost_outcome(matching the pattern already used inEventModulesAnonymizedRollup) and switched all three aggregations to vectorized'sum'. Retainedhost_outcomeand added_ensure_outcome_columns()for callers invoking aggregation helpers directly.Testing
Steps to Test
1. Run unit tests (including 10 new tests covering outcome counts,
darkprecedence overfailures, flag dtypes, direct helper calls, and missingjob_remote_id):2. Run paired alternating-order benchmark of
JobHostSummaryAnonymizedRollup.prepare()on 100,000 synthetic rows across 4,000 jobs in a containerized AAPcont_bController (automation-controller-task, Python 3.12.16, pandas 3.0.3; excludes DB collection).Expected Results
test_jobhostsummary_anonymized_rollups.pypass.JobHostSummaryAnonymizedRollup.prepare()median time dropped from 1.231 s to 0.227 s (−81.56%, 5.4× faster), peak RSS flat (151.90 → 152.35 MiB), with identical JSON output digests across all 6 runs.Self-Review Checklist
Code Quality
- If updates are required in the handbook, create a separate PR for the handbook repo.