@dollhousemcp/mcp-server
Version:
DollhouseMCP - A Model Context Protocol (MCP) server that enables dynamic AI persona management from markdown files, allowing Claude and other compatible AI assistants to activate and switch between different behavioral personas.
54 lines • 1.52 kB
TypeScript
/**
* StartupTimer — Lightweight startup phase timing instrumentation.
*
* Tracks per-phase durations during server initialization, split into
* critical (pre-connect) and deferred (post-connect) categories.
*
* Registered as a DI singleton so BuildInfoService can expose timings
* via `get_build_info`.
*
* Issue #706: MCP Startup Race Hardening
*/
export interface PhaseEntry {
name: string;
critical: boolean;
startMs: number;
endMs: number | null;
durationMs: number | null;
}
export interface StartupReport {
phases: Array<{
name: string;
critical: boolean;
durationMs: number;
}>;
criticalPathMs: number;
deferredMs: number;
totalMs: number;
connectAtMs: number | null;
}
export declare class StartupTimer {
private phases;
private originMs;
private connectAtMs;
constructor();
/**
* Begin timing a named phase.
* @param name Unique phase identifier (e.g. "config_manager")
* @param critical true = pre-connect critical path, false = deferred
*/
startPhase(name: string, critical: boolean): void;
/**
* End a previously started phase. Idempotent — second call is a no-op.
*/
endPhase(name: string): void;
/**
* Record the instant MCP `server.connect()` completes.
*/
markConnect(): void;
/**
* Produce the final report. Un-ended phases are auto-closed.
*/
getReport(): StartupReport;
}
//# sourceMappingURL=StartupTimer.d.ts.map