spark icon indicating copy to clipboard operation
spark copied to clipboard

Refactor health reporting methods

Open Abhiram98 opened this issue 6 months ago • 0 comments

This PR includes refactoring changes after looking at #436, mainly to split long methods into smaller ones that can be extended in the future. I am happy to revert some of these changes if necessary.

List of changes performed:

HealthModule.java

  • Rename 'data' -> 'healthData'
  • split code inside try block of 'uploadHealthReport' into 'uploadHealthReportWithBroadcast'.

PlatformStatisticsProvider.java

  • Convert for loop to stream, and extract helper method for conciseness
  • split 'getPlatformStatistics' into multiple methods that can be extended in the future: 'addMemoryStatistics', 'addGarbageCollectorStatistics', 'addTickStatistics', 'addPingStatistics', 'addPlayerStatistics'.

Abhiram98 avatar Aug 07 '24 22:08 Abhiram98