import { type ICoretrafficPortRouteConfig, type IReverseProxyConfig } from '../data/traffic.js'; export interface IRequest_Coreflow_Coretraffic_RoutingUpdate { method: 'updateRouting'; request: { reverseConfigs: IReverseProxyConfig[]; portRoutes?: ICoretrafficPortRouteConfig[]; }; response: { status: 'ok' | 'error'; errorText: string; }; } /** * Coretraffic pulls the current routing table when it (re)connects. * Coretraffic holds routes only in memory, so a proxy restart would * otherwise serve nothing until the next coreflow reconcile pushes. */ export interface IRequest_Coretraffic_Coreflow_GetCurrentRouting { method: 'getCurrentRouting'; request: Record; response: { reverseConfigs: IReverseProxyConfig[]; portRoutes?: ICoretrafficPortRouteConfig[]; }; } /** * Live proxy traffic rates for one served hostname. */ export interface ITrafficHostStats { hostName: string; bytesInPerSec: number; bytesOutPerSec: number; requestsPerSec: number; connectionsActive: number; } /** * Coreflow asks its local coretraffic for current per-hostname traffic * rates (sourced from the proxy's metrics, not persisted). */ export interface IRequest_Coreflow_Coretraffic_GetTrafficStats { method: 'getTrafficStats'; request: { windowSeconds?: number; }; response: { hosts: ITrafficHostStats[]; timestamp: number; }; } /** * Cloudly asks a node's coreflow for that node's current proxy traffic * rates; coreflow relays to its local coretraffic. */ export interface IRequest_Cloudly_Coreflow_GetTrafficStats { method: 'coreflowGetTrafficStats'; request: { windowSeconds?: number; }; response: { hosts: ITrafficHostStats[]; timestamp: number; }; }