Fix status filter OR logic and add P99/active stats endpoint
Status filter now parses comma-separated values into SQL IN clause instead of exact match, so filtering by multiple statuses works. Added GET /api/v1/search/stats returning P99 latency (last hour) and active execution count, wired into the UI stat cards with 10s polling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
package com.cameleer3.server.core.search;
|
||||
|
||||
/**
|
||||
* Aggregate execution statistics.
|
||||
*
|
||||
* @param p99LatencyMs 99th percentile duration in milliseconds (last hour)
|
||||
* @param activeCount number of currently running executions
|
||||
*/
|
||||
public record ExecutionStats(long p99LatencyMs, long activeCount) {}
|
||||
@@ -24,4 +24,11 @@ public interface SearchEngine {
|
||||
* @return total number of matching executions
|
||||
*/
|
||||
long count(SearchRequest request);
|
||||
|
||||
/**
|
||||
* Compute aggregate stats: P99 latency and count of currently running executions.
|
||||
*
|
||||
* @return execution stats
|
||||
*/
|
||||
ExecutionStats stats();
|
||||
}
|
||||
|
||||
@@ -28,4 +28,11 @@ public class SearchService {
|
||||
public long count(SearchRequest request) {
|
||||
return engine.count(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute aggregate execution stats (P99 latency, active count).
|
||||
*/
|
||||
public ExecutionStats stats() {
|
||||
return engine.stats();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user