import { GetTunnelUsageQuery } from '../../generated/wspace-operations'; export type TunnelUsageBucket = GetTunnelUsageQuery['tunnelUsage'][number]; /** Hours in the rolling window the tunnel metric tiles summarise. */ export declare const TUNNEL_METRIC_WINDOW_HOURS = 24; export interface TunnelUsageSummary { /** Buckets ordered oldest → newest, one per hour the backend rolled up. */ ordered: TunnelUsageBucket[]; bytesIn: number; bytesOut: number; bytesTotal: number; requests: number; connections: number; /** Per-hour series, aligned with `ordered`, for the sparklines. */ bytesSeries: number[]; requestSeries: number[]; connectionSeries: number[]; /** Highest single-hour connection count in the window. */ peakConnections: number; } /** * Fold the hourly `tunnelUsage` buckets into the totals and per-hour series the * Overview tiles render. Everything here is derived from fields the backend * actually returns (`bytesIn`, `bytesOut`, `requests`, `connections`) — no * metric is synthesised. */ export declare function summariseTunnelUsage(buckets: readonly TunnelUsageBucket[]): TunnelUsageSummary; /** Human-readable byte count (binary units, matching the Usage tab's table). */ export declare function formatBytes(n: number): string; /** * Average rate over a window, expressed in whichever unit keeps the number * readable. Returns the numeric value plus the unit suffix so the caller can * translate the suffix. */ export declare function averageRatePerHour(total: number, hours: number): number; /** Format a per-hour rate as `/s`, `/min` or `/hr` depending on magnitude. */ export declare function formatPerHourRate(ratePerHour: number): { value: string; unit: 'sec' | 'min' | 'hr'; };