Make stats endpoint respect selected time window instead of hardcoded last hour
P99 latency and active count now use the same from/to parameters as the timeseries sparklines, so all stat cards are consistent with the user's selected time range. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@ package com.cameleer3.server.core.search;
|
||||
/**
|
||||
* Aggregate execution statistics.
|
||||
*
|
||||
* @param p99LatencyMs 99th percentile duration in milliseconds (last hour)
|
||||
* @param p99LatencyMs 99th percentile duration in milliseconds within the requested time window
|
||||
* @param activeCount number of currently running executions
|
||||
*/
|
||||
public record ExecutionStats(long p99LatencyMs, long activeCount) {}
|
||||
|
||||
@@ -28,9 +28,11 @@ public interface SearchEngine {
|
||||
/**
|
||||
* Compute aggregate stats: P99 latency and count of currently running executions.
|
||||
*
|
||||
* @param from start of the time window
|
||||
* @param to end of the time window
|
||||
* @return execution stats
|
||||
*/
|
||||
ExecutionStats stats();
|
||||
ExecutionStats stats(java.time.Instant from, java.time.Instant to);
|
||||
|
||||
/**
|
||||
* Compute bucketed time-series stats over a time window.
|
||||
|
||||
@@ -32,8 +32,8 @@ public class SearchService {
|
||||
/**
|
||||
* Compute aggregate execution stats (P99 latency, active count).
|
||||
*/
|
||||
public ExecutionStats stats() {
|
||||
return engine.stats();
|
||||
public ExecutionStats stats(java.time.Instant from, java.time.Instant to) {
|
||||
return engine.stats(from, to);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user