mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-23 21:59:14 +09:00
Checkpoint: File edits
Automatic checkpoint created by Claude Code - Branch: v3 - Timestamp: 2026-01-07T15:05:00Z - Changes: 1 file(s) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f8b1d4cd35
commit
943fbfa783
1 file changed
+29
@@ -1,7 +1,36 @@
|
||||
/**
|
||||
* Coverage Router for Test Routing
|
||||
*
|
||||
* Optimizations:
|
||||
* - Async file I/O for non-blocking coverage loading
|
||||
* - TTL-based caching of coverage data
|
||||
* - Singleton router instance
|
||||
*/
|
||||
|
||||
// ============================================================================
|
||||
// Caching for Performance
|
||||
// ============================================================================
|
||||
|
||||
/**
|
||||
* Cache for coverage data (1 minute TTL)
|
||||
*/
|
||||
const coverageDataCache = new Map<string, { report: CoverageReport; timestamp: number }>();
|
||||
const COVERAGE_CACHE_TTL_MS = 60 * 1000; // 1 minute
|
||||
|
||||
/**
|
||||
* Clear coverage cache
|
||||
*/
|
||||
export function clearCoverageCache(): void {
|
||||
coverageDataCache.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get coverage cache stats
|
||||
*/
|
||||
export function getCoverageCacheStats(): { size: number } {
|
||||
return { size: coverageDataCache.size };
|
||||
}
|
||||
|
||||
export interface CoverageRouterConfig {
|
||||
minCoverage: number;
|
||||
targetCoverage: number;
|
||||
|
||||
Reference in new issue
Block a user