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

Fix storage accumulation and improve error handling in processUsageRe… #23

Merged
merged 1 commit into from
Feb 25, 2025

Conversation

thang14
Copy link
Contributor

@thang14 thang14 commented Feb 25, 2025

This pull request includes improvements to the processUsageReports function in the core/apps/verifier/verifier.go file. The changes focus on handling empty peer logs and correcting the accumulation of resource usage metrics.

Improvements to processUsageReports function:

  • Added a check to skip processing if peerLogs is empty.
  • Corrected the accumulation of Memory, UploadBytes, DownloadBytes, and Storage metrics by using the += operator instead of =.
  • Added a check to ensure that resource usage metrics are averaged only if there are peer logs present.…ports
  • Corrected storage accumulation (+= instead of =+)
  • Added check to prevent division by zero when averaging
  • Improved error handling by logging instead of returning immediately
  • Ensured consistent timestamp usage with UTC"

…ports

- Corrected storage accumulation (+= instead of =+)
- Added check to prevent division by zero when averaging
- Improved error handling by logging instead of returning immediately
- Ensured consistent timestamp usage with UTC"
@thang14 thang14 merged commit 53a67bd into main Feb 25, 2025
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