Skip to content

perf: cache attestation health metrics incrementally#528

Closed
dangelo352 wants to merge 1 commit into
Commitlabs-Org:masterfrom
dangelo352:perf/attestation-aggregate-cache-496
Closed

perf: cache attestation health metrics incrementally#528
dangelo352 wants to merge 1 commit into
Commitlabs-Org:masterfrom
dangelo352:perf/attestation-aggregate-cache-496

Conversation

@dangelo352

Copy link
Copy Markdown

Summary

  • update attestation_engine HealthMetrics from each new attestation instead of reducing full history on every write
  • mark updater-written caches so get_health_metrics/calculate_compliance_score can use O(1) cached aggregate fields while legacy/manual caches still fall back to full recomputation
  • add cached-vs-full-recompute equivalence coverage for mixed fee/drawdown attestations
  • document the before/after cost shape in benchmarks/results

Fixes #496.

Tests

  • CARGO_TARGET_DIR=/tmp/commitlabs-attestation-cache-target cargo test -p attestation_engine health_metrics -- --nocapture
  • CARGO_TARGET_DIR=/tmp/commitlabs-attestation-cache-target cargo test -p attestation_engine incremental_health_metrics -- --nocapture
  • CARGO_TARGET_DIR=/tmp/commitlabs-attestation-cache-target cargo test -p attestation_engine record_fees -- --nocapture
  • CARGO_TARGET_DIR=/tmp/commitlabs-attestation-cache-target cargo test -p attestation_engine record_drawdown -- --nocapture
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize attestation_engine analytics counters to avoid full-history recomputation

2 participants