/**
 * Analytics Types
 *
 * Type definitions for the server performance analytics system.
 *
 * @since v1.70.0
 */
/**
 * Memory metrics
 */
export interface MemoryMetrics {
    used: number;
    allocated: number;
    max: number;
    gcCount: number;
    gcTime: number;
}
/**
 * CPU metrics
 */
export interface CPUMetrics {
    process: number;
    system: number;
    loadAverage: number[];
}
/**
 * Event handler metrics
 */
export interface EventHandlerMetrics {
    event: string;
    count: number;
    avgTime: number;
    maxTime: number;
    totalTime: number;
}
/**
 * Per-plugin metrics
 */
export interface PluginMetrics {
    pluginId: string;
    name: string;
    version: string;
    tickTime: number;
    tickTimeMax: number;
    tickPercent: number;
    eventHandlers: EventHandlerMetrics[];
    scheduledTasks: number;
    asyncTasks: number;
    memoryEstimate?: number;
}
/**
 * Performance event (lag spike, GC pause, etc.)
 */
export interface PerformanceEvent {
    type: 'lag_spike' | 'gc_pause' | 'chunk_load' | 'entity_spawn' | 'custom';
    timestamp: number;
    duration: number;
    severity: 'low' | 'medium' | 'high' | 'critical';
    details?: Record<string, unknown>;
}
/**
 * Server type
 */
export type ServerType = 'vanilla' | 'spigot' | 'paper' | 'purpur' | 'fabric' | 'forge' | 'velocity' | 'bungeecord' | 'unknown';
/**
 * Complete performance metrics snapshot
 */
export interface PerformanceMetrics {
    timestamp: number;
    serverId: string;
    serverType: ServerType;
    mcVersion: string;
    server: {
        tps: number;
        mspt: number;
        memory: MemoryMetrics;
        cpu: CPUMetrics;
        players: number;
        maxPlayers: number;
        entities: number;
        chunks: number;
        worlds: number;
    };
    plugins: PluginMetrics[];
    events?: PerformanceEvent[];
}
/**
 * Metrics aggregation period
 */
export type AggregationPeriod = 'minute' | 'hour' | 'day' | 'week';
/**
 * Aggregated metrics
 */
export interface AggregatedMetrics {
    period: AggregationPeriod;
    startTime: number;
    endTime: number;
    sampleCount: number;
    server: {
        avgTps: number;
        minTps: number;
        maxTps: number;
        avgMspt: number;
        maxMspt: number;
        avgMemoryUsed: number;
        maxMemoryUsed: number;
        avgMemoryPercent: number;
        avgCpuPercent: number;
        avgPlayers: number;
        maxPlayers: number;
        avgEntities: number;
        maxEntities: number;
    };
    plugins: Array<{
        pluginId: string;
        name: string;
        avgTickTime: number;
        maxTickTime: number;
        avgTickPercent: number;
    }>;
    events: {
        lagSpikes: number;
        gcPauses: number;
        total: number;
    };
}
/**
 * Spark report data (parsed)
 */
export interface SparkReportData {
    metadata: {
        platform: string;
        platformVersion: string;
        sparkVersion: string;
        generatedAt: number;
    };
    platform: {
        tps: {
            last1m: number;
            last5m: number;
            last15m: number;
        };
        mspt: {
            mean: number;
            min: number;
            max: number;
            p95: number;
            p99: number;
        };
        memory: {
            used: number;
            allocated: number;
            max: number;
        };
        gc: {
            avgFrequency: number;
            avgTime: number;
        };
    };
    samplerData?: {
        threads: Array<{
            name: string;
            time: number;
            children: Array<{
                name: string;
                time: number;
                children?: unknown[];
            }>;
        }>;
    };
}
/**
 * Timings report data (parsed)
 */
export interface TimingsReportData {
    metadata: {
        version: string;
        serverName: string;
        onlineMode: boolean;
        sampleTime: number;
    };
    timingsMaster: {
        tps: number;
        totalTicks: number;
        totalTime: number;
    };
    plugins: Record<string, {
        total: number;
        count: number;
        avg: number;
        handlers: Array<{
            name: string;
            total: number;
            count: number;
        }>;
    }>;
}
/**
 * Data source type
 */
export type MetricsSource = 'spark' | 'timings' | 'manual' | 'panel' | 'log';
/**
 * Metrics collection result
 */
export interface MetricsCollectionResult {
    success: boolean;
    source: MetricsSource;
    metrics?: PerformanceMetrics;
    error?: string;
    collectedAt: number;
}
/**
 * Storage configuration
 */
export interface MetricsStorageConfig {
    maxRawSamples: number;
    aggregationEnabled: boolean;
    retentionDays: {
        raw: number;
        hourly: number;
        daily: number;
    };
}
/**
 * Default storage config
 */
export declare const DEFAULT_STORAGE_CONFIG: MetricsStorageConfig;
/**
 * Alert condition
 */
export interface AlertCondition {
    metric: 'tps' | 'mspt' | 'memory' | 'cpu' | 'plugin_tick';
    operator: '<' | '>' | '=' | '<=' | '>=';
    value: number;
    duration?: number;
    pluginId?: string;
}
/**
 * Alert action
 */
export interface AlertAction {
    type: 'command' | 'restart' | 'notify' | 'log';
    command?: string;
    webhookUrl?: string;
}
/**
 * Performance alert definition
 */
export interface PerformanceAlert {
    id: string;
    name: string;
    enabled: boolean;
    condition: AlertCondition;
    severity: 'critical' | 'warning' | 'info';
    notifyVia: Array<'ui' | 'desktop' | 'webhook'>;
    cooldown: number;
    autoAction?: AlertAction;
}
/**
 * Alert trigger event
 */
export interface AlertTrigger {
    alertId: string;
    alertName: string;
    severity: PerformanceAlert['severity'];
    triggeredAt: number;
    condition: AlertCondition;
    currentValue: number;
    message: string;
}
/**
 * Default performance alerts
 */
export declare const DEFAULT_ALERTS: PerformanceAlert[];
/**
 * Optimization recommendation
 */
export interface OptimizationRecommendation {
    id?: string;
    title: string;
    description: string;
    priority: 'critical' | 'high' | 'medium' | 'low';
    category: 'plugin' | 'config' | 'server' | 'resource' | 'memory' | 'configuration' | 'hardware';
    impact: string;
    pluginId?: string;
    actions?: string[];
    configChanges?: Array<{
        file: string;
        key: string;
        currentValue: unknown;
        recommendedValue: unknown;
    }>;
    guide?: string;
    createdAt?: number;
}
/**
 * Performance baseline
 */
export interface PerformanceBaseline {
    id: string;
    name: string;
    createdAt: number;
    description?: string;
    metrics: {
        avgTps: number;
        avgMspt: number;
        avgMemoryPercent: number;
        avgCpuPercent: number;
        avgPlayers: number;
    };
    plugins: Array<{
        pluginId: string;
        name: string;
        avgTickTime: number;
        avgTickPercent: number;
    }>;
    samplePeriod: {
        start: number;
        end: number;
        samples: number;
    };
    tags?: string[];
    pluginIds?: string[];
}
/**
 * Metric change details
 */
export interface MetricChange {
    baseline: number;
    current: number;
    change: number;
    improved: boolean;
}
/**
 * Plugin change details
 */
export interface PluginChange {
    pluginId: string;
    name: string;
    tickTimeChange: number;
    tickPercentChange: number;
}
/**
 * Performance comparison result
 */
export interface PerformanceComparison {
    baselineId: string;
    baselineName: string;
    comparedAt: number;
    samplePeriod: {
        start: number;
        end: number;
        samples: number;
    } | AggregationPeriod;
    changes: {
        tps: MetricChange;
        mspt: MetricChange;
        memory: MetricChange;
        cpu: MetricChange;
    };
    plugins: PluginChange[];
    verdict: 'improved' | 'degraded' | 'unchanged' | 'stable' | 'mixed';
}
//# sourceMappingURL=analytics-types.d.ts.map