Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weighted Average for Phase Stats #1040

Merged
merged 2 commits into from
Jan 10, 2025
Merged

Weighted Average for Phase Stats #1040

merged 2 commits into from
Jan 10, 2025

Conversation

ArneTR
Copy link
Member

@ArneTR ArneTR commented Jan 5, 2025

(improvement): Phases Stats for CPU Utilization etc. now have weighte…

Greptile Summary

Implemented weighted average calculations for phase statistics in the Green Metrics Tool, improving the accuracy of metrics like CPU utilization by accounting for time intervals between measurements.

  • Added weighted average calculation in phase_stats.py using LAG time differences for more accurate metrics
  • Implemented classic average fallback when fewer than 3 measurements exist
  • Modified SQL query to include ORDER BY clause ensuring correct LAG calculations
  • Updated test values in test_phase_stats.py to reflect new weighted averaging (e.g. CPU utilization from 1985 to 1983)
  • Converted all weighted averages to Decimal type for consistent precision handling

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@ArneTR ArneTR merged commit 6078b1c into main Jan 10, 2025
3 of 4 checks passed
@ArneTR ArneTR deleted the phase-stats-weighted-average branch January 10, 2025 07:28
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.

1 participant