Severity: 🟠 · Criterion: K7 / K6 · Phase: P3 · Status (review): 🆕
File(s): src/DockerUpdateGuard/Images/ResourceStatisticsCollector.cs:167-176
Finding
CollectForInstanceAsync loads all RuntimeContainerResourceSamples of the instance
(Where(instance).OrderByDescending(RecordedAtUtc).AsNoTracking().ToListAsync()), only to determine
via GroupBy(ContainerId).First() the most recent sample per container for the delta calculation.
The table grows between cleanups; with a short sampling interval, more and more rows are loaded
per run. (The instance sample correctly uses FirstOrDefaultAsync.)
Impact
Growing memory/CPU cost in a frequent periodic path, scaling
with retention × frequency × container count; avoidable.
Recommendation
Load only the most recent sample per container (grouped/window query or filter to
a narrow time window).
Auto-generated from the repository code review. Source of truth: docs/review/findings.md → F-026 (P3), branch review/review-analysis-plan.
Severity: 🟠 · Criterion: K7 / K6 · Phase: P3 · Status (review): 🆕
File(s):
src/DockerUpdateGuard/Images/ResourceStatisticsCollector.cs:167-176Finding
CollectForInstanceAsyncloads allRuntimeContainerResourceSamplesof the instance(
Where(instance).OrderByDescending(RecordedAtUtc).AsNoTracking().ToListAsync()), only to determinevia
GroupBy(ContainerId).First()the most recent sample per container for the delta calculation.The table grows between cleanups; with a short sampling interval, more and more rows are loaded
per run. (The instance sample correctly uses
FirstOrDefaultAsync.)Impact
Growing memory/CPU cost in a frequent periodic path, scaling
with retention × frequency × container count; avoidable.
Recommendation
Load only the most recent sample per container (grouped/window query or filter to
a narrow time window).
Auto-generated from the repository code review. Source of truth:
docs/review/findings.md→ F-026 (P3), branchreview/review-analysis-plan.