lucas-a-martins opened a new pull request, #10492:
URL: https://github.com/apache/cloudstack/pull/10492

   ### Description
   
   Currently, the Stats Collector can throw an arithmetic exception when trying 
to divide by zero if `interval = 0`.
   
   This PR fixes this issue by setting the `loadHistory.add` value to zero when 
the `interval` variable is equal to zero.
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [x] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] build/CI
   - [ ] test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [x] Minor
   
   ### Screenshots (if appropriate):
   
   ### How Has This Been Tested?
   
   In debug mode, I tested by setting the `interval` value to zero. Before the 
changes, an arithmetic exception was thrown. After the changes, I got no 
exception and could check that the value added to `loadHistory` was equal to 
`0`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to