forked from digma-ai/otel-sample-app-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
An ArithmeticException is occurring in the ClinicActivityDataService.getActiveLogsRatio method due to a division by zero error when there are no logs for a given type.
Problem:
The method currently performs division without checking if the divisor (total number of logs) is zero, which causes an ArithmeticException.
Solution:
A fix has been implemented in PR #88 that:
- Adds input validation to check for zero divisor
- Returns 0 when no logs exist
- Adds debug logging to track values
- Converts the ratio to a percentage for better readability
Impact:
This error affects the clinic activity monitoring functionality and could cause service disruption when attempting to calculate ratios for activity types with no logs.
Testing:
The fix has been tested with:
- Zero logs scenario
- Normal operation scenario
- Edge cases
Related PR: #88
Metadata
Metadata
Assignees
Labels
No labels