/**
 * @fileoverview Monitoring and metrics utilities for Supabase Edge Functions
 * @description Provides metrics collection and analytics queries using Postgres table
 *
 * @version 0.1.0
 * @since 0.5.0
 * @author AMBROISE PARK Consulting
 */
import type { SupabaseClient } from '@supabase/supabase-js';
/**
 * Operation metrics data structure
 */
export interface OperationMetrics {
    operation: string;
    userId?: string;
    status: 'success' | 'failed' | 'pending';
    durationMs?: number;
    metadata?: Record<string, any>;
    errorCode?: string;
    errorMessage?: string;
}
/**
 * Record operation metrics for monitoring
 *
 * @param supabaseAdmin - Supabase admin client
 * @param metrics - Operation metrics to record
 */
export declare function recordOperationMetrics(supabaseAdmin: SupabaseClient, metrics: OperationMetrics): Promise<void>;
/**
 * Get failure rate for an operation
 *
 * @param supabaseAdmin - Supabase admin client
 * @param operation - Operation name
 * @param hours - Time window in hours (default: 24)
 * @returns Failure rate (0-100)
 */
export declare function getFailureRate(supabaseAdmin: SupabaseClient, operation: string, hours?: number): Promise<number>;
/**
 * Get operation counts by user
 *
 * @param supabaseAdmin - Supabase admin client
 * @param userId - User ID
 * @param hours - Time window in hours (default: 24)
 * @returns Record of operation names to counts
 */
export declare function getOperationCounts(supabaseAdmin: SupabaseClient, userId: string, hours?: number): Promise<Record<string, number>>;
/**
 * Get slow operations (above threshold)
 *
 * @param supabaseAdmin - Supabase admin client
 * @param thresholdMs - Duration threshold in milliseconds
 * @param hours - Time window in hours (default: 24)
 * @returns Array of operations with average duration
 */
export declare function getSlowOperations(supabaseAdmin: SupabaseClient, thresholdMs: number, hours?: number): Promise<Array<{
    operation: string;
    avgDuration: number;
    count: number;
}>>;
