@dudousxd/nestjs-telescope
Version:
Laravel Telescope-style observability console for NestJS — core: watchers, recorder, correlation, SQLite store, headless API.
32 lines • 1.77 kB
TypeScript
import type { Entry } from '../entry/entry.js';
import type { RollupBucket, RollupDelta, RollupStore } from '../rollup/rollup-store.js';
import type { EntryQuery, EntryWithBatch, Page, PruneScope, StorageProvider, TagCount } from './storage-provider.js';
/**
* Process-local store. Used as a test double and as a zero-dependency option
* for single-instance/serverless setups. Newest-first ordering by createdAt
* then id; cursor is an opaque keyset (createdAt-ms, id) position.
*/
export declare class InMemoryStorageProvider implements StorageProvider, RollupStore {
private entries;
/** Materialized rollups keyed `${metric}|${bucketStart}`. */
private rollups;
store(entries: Entry[]): Promise<void>;
update(id: string, patch: Partial<Entry>): Promise<void>;
find(id: string): Promise<EntryWithBatch | null>;
get(query: EntryQuery): Promise<Page<Entry>>;
batch(batchId: string): Promise<Entry[]>;
tags(prefix?: string): Promise<TagCount[]>;
prune(olderThan: Date, keepLast?: number): Promise<number>;
pruneScoped(input: PruneScope): Promise<number>;
clear(): Promise<void>;
/** Last-seen wall time (ms) per error family, backing the shared new-exception
* dedup. In a single process this is exactly the per-replica behaviour; the
* real cross-pod win comes from the SQLite/Redis providers that share a store. */
private readonly seenFamilies;
markFamilySeen(familyHash: string, nowMs: number, windowMs: number): Promise<boolean>;
recordRollups(deltas: RollupDelta[]): Promise<void>;
queryRollups(metrics: string[], fromBucket: number, toBucket: number): Promise<RollupBucket[]>;
private matches;
private newestFirst;
}
//# sourceMappingURL=in-memory-storage-provider.d.ts.map