@iota-big3/sdk-regulated
Version:
Regulated Industries SDK for Healthcare, Finance, and Government
58 lines • 1.86 kB
TypeScript
import { EventEmitter } from 'events';
import { Logger } from 'winston';
export interface PerformanceMetric {
name: string;
value: number;
unit: 'ms' | 'bytes' | 'count' | 'percent';
timestamp: Date;
tags: Record<string, string>;
}
export interface MetricThreshold {
metric: string;
operator: '>' | '<' | '>=' | '<=' | '==' | '!=';
value: number;
severity: 'warning' | 'critical';
description: string;
}
export interface PerformanceDashboard {
id: string;
name: string;
refreshInterval: number;
metrics: string[];
layout: Array<{
type: 'gauge' | 'timeseries' | 'heatmap' | 'counter';
metric: string;
position: {
x: number;
y: number;
w: number;
h: number;
};
}>;
}
export declare class PerformanceMonitor extends EventEmitter {
private metrics;
private thresholds;
private dashboards;
private collectors;
private logger;
private retentionPeriod;
constructor(logger: Logger);
record(metric: PerformanceMetric): void;
time<T>(operation: string, tags: Record<string, string>, fn: () => Promise<T>): Promise<T>;
setThreshold(threshold: MetricThreshold): void;
createDashboard(dashboard: PerformanceDashboard): void;
getDashboardData(dashboardId: string): any;
getMetrics(name: string, tags?: Record<string, string>): PerformanceMetric[];
calculateStats(metrics: PerformanceMetric[]): any;
private setupDefaultCollectors;
private checkThresholds;
private cleanupOldMetrics;
private refreshDashboard;
private percentile;
private getMetricKey;
cleanup(): void;
}
export declare const RegulatedDashboards: PerformanceDashboard[];
export declare const RegulatedThresholds: MetricThreshold[];
//# sourceMappingURL=performance-monitor.d.ts.map