/** * How many Receiver instances enforce a container's cap. * * The rate regulator counts bytes per pattern per container inside each * Receiver. A DaemonSet Receiver sees only the pods on its own node, so a cap * derived from a container's fleet-wide rate must be divided by the nodes that * container's pods run on. A Receiver beside a central forwarder sees the * container's whole stream, so its cap is not divided. */ export type ReceiverMode = 'daemonset' | 'sidecar'; /** Where an instance count came from, stated beside it in the plan. */ export type InstanceBasis = 'argument' | 'discovery' | 'pod_list' | 'sidecar' | 'unknown'; export interface EnforcingInstances { mode: ReceiverMode; byContainer: Record; } export declare function resolveEnforcingInstances(containers: string[], opts: { mode?: ReceiverMode; /** Caller-supplied node counts, keyed by container. */ nodesByContainer?: Record; /** Node counts from a discover_env snapshot. */ discovered?: Record; /** Node counts from the pods a POC listed. */ fromPods?: Record; }): EnforcingInstances; export declare function instancesFor(e: EnforcingInstances | undefined, container: string): number; /** A per-window cap for one Receiver: the fleet-wide cap over the instances, at least 1 byte. */ export declare function perInstanceCap(fleetCapBytes: number, instances: number): number; /** The median instance count across containers with a known count; 1 when none is known. */ export declare function medianInstances(e: EnforcingInstances): { median: number; known: number; }; /** "checkout: per node, 3 nodes from discovery" and the like, one per container. */ export declare function describeInstances(e: EnforcingInstances, container: string): string; /** True when any container's count is unknown, so the plan can say what to pass. */ export declare function anyUnknown(e: EnforcingInstances): boolean; /** * Distinct nodes per container name from `kubectl get pods` JSON items. Keyed * by container name because the regulator keys caps by the container field. */ export declare function nodesPerContainerFromPods(pods: Array<{ nodeName?: string; containers?: string[]; }>): Record; /** * Divide each `,[::]` row of a caps.csv by the * container's enforcing instances. Header and `#` preamble lines pass through. */ export declare function divideCapCsv(capsCsv: string, e: EnforcingInstances): string;