/** * Metrics Collector Service * * Tracks and aggregates performance metrics for ABAC engine evaluations. * Provides insights into engine performance, decision distribution, and error rates. */ import { ABACDecision, EvaluationMetrics } from '../types'; /** * Service for collecting and managing performance metrics */ export declare class MetricsCollector { private metrics; private enabled; constructor(enabled?: boolean); /** * Record a policy evaluation * * @param decision - The decision result * @param evaluationTime - Time taken to evaluate (in milliseconds) * @param policyIds - IDs of policies that were evaluated */ record(decision: ABACDecision, evaluationTime: number, policyIds?: string[]): void; /** * Get current metrics * * @returns Copy of current metrics */ getMetrics(): EvaluationMetrics; /** * Reset all metrics to initial state */ reset(): void; /** * Enable metrics collection */ enable(): void; /** * Disable metrics collection */ disable(): void; /** * Check if metrics collection is enabled * * @returns true if enabled, false otherwise */ isEnabled(): boolean; /** * Get metrics summary as a formatted string * * @returns Formatted metrics summary */ getSummary(): string; /** * Get percentage for a decision type */ private getPercentage; /** * Get metrics for a specific policy * * @param policyId - Policy ID * @returns Hit count for the policy */ getPolicyMetrics(policyId: string): number; /** * Get top N policies by hit count * * @param limit - Number of policies to return * @returns Array of [policyId, hitCount] tuples */ getTopPolicies(limit?: number): Array<[string, number]>; } //# sourceMappingURL=MetricsCollector.d.ts.map