@dudousxd/nestjs-telescope
Version:
Laravel Telescope-style observability console for NestJS — core: watchers, recorder, correlation, SQLite store, headless API.
40 lines • 1.78 kB
TypeScript
import type { StorageProvider } from '../storage/storage-provider.js';
import { type PulseSummary } from './pulse-summary.js';
export interface PulseServiceOptions {
pageSize?: number;
scanCap?: number;
/** How many slowest entries / exception groups / N+1 occurrences to return. Default 5. */
topN?: number;
/** Min repetitions of one query template in a batch to flag N+1. Default 5. */
nPlusOneThreshold?: number;
/** Min request count for a route to qualify as a slow-route hotspot. Default 1. */
slowRouteMinCount?: number;
/**
* Min p99 (ms) for a route to count as a slow-route hotspot — a route only
* surfaces in "Slow request hotspots" when its p99 is **>= slowRouteMs**.
* Default 1000, matching the `slow` request-tag threshold so a "hotspot"
* means the same thing as the `slow` tag. Lower it on a latency-sensitive
* service; raise it to only flag egregious routes.
*/
slowRouteMs?: number;
}
export interface PulseResult extends PulseSummary {
scanned: number;
truncated: boolean;
}
/** Computes a health snapshot by aggregating stored entries over a time window.
* Reads the store (source of truth) on demand — no live counters. */
export declare class PulseService {
private readonly storage;
private readonly pageSize;
private readonly scanCap;
private readonly topN;
private readonly nPlusOneThreshold;
private readonly slowRouteMinCount;
private readonly slowRouteMs;
constructor(storage: StorageProvider, options?: PulseServiceOptions);
getHealth(windowMs: number): Promise<PulseResult>;
/** Fetch content for the deduplicated set of ids the pulse output displays. */
private hydrate;
}
//# sourceMappingURL=pulse.service.d.ts.map