23 lines
559 B
TypeScript
23 lines
559 B
TypeScript
|
|
import { Controller, Get } from "@nestjs/common";
|
||
|
|
import { CatalogCacheService } from "./services/catalog-cache.service";
|
||
|
|
|
||
|
|
@Controller("health/catalog")
|
||
|
|
export class CatalogHealthController {
|
||
|
|
constructor(private readonly catalogCache: CatalogCacheService) {}
|
||
|
|
|
||
|
|
@Get("cache")
|
||
|
|
getCacheMetrics() {
|
||
|
|
return {
|
||
|
|
timestamp: new Date().toISOString(),
|
||
|
|
metrics: this.catalogCache.getMetrics(),
|
||
|
|
ttl: {
|
||
|
|
catalogSeconds: 3600,
|
||
|
|
eligibilitySeconds: 900,
|
||
|
|
staticSeconds: 900,
|
||
|
|
volatileSeconds: 60,
|
||
|
|
},
|
||
|
|
};
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|