Aias00 opened a new issue, #6497:
URL: https://github.com/apache/shenyu/issues/6497
### Current Behavior
Instance status history is appended once per instance during each scheduled
check instead of once per check cycle.
`InstanceCheckService.doCheck()` iterates every cached instance and calls
`collectStateData()` inside the loop:
```java
instanceHealthBeatInfo.values().forEach(instance -> {
... update one instance state ...
collectStateData();
});
```
`collectStateData()` groups all instances by state and appends the counts to
`stateHistoryMap` via `updateStateHistory(...)`. With N instances, a single
scheduled run appends N history points. The values can also represent
intermediate state while the loop is still updating later instances.
### Expected Behavior
The service should update all instance states first, then append one
aggregated history sample per scheduled check cycle.
### Impact
The instance data visual API can show compressed/duplicated history and
faster-than-real timeline movement when more than one instance is tracked.
### Code Location
-
`shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/InstanceCheckService.java`
- `doCheck()` calls `collectStateData()` inside the per-instance loop.
- `getInstanceDataVisual()` reads `stateHistoryMap` for the line chart
returned by `InstanceController`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]