UNPKG

consul-resolver

Version:

A load balancer for Consul services with Redis-based metrics

17 lines (16 loc) 767 B
import Redis from "ioredis"; import { DEFAULT_METRICS, ServiceHealth, ServiceMetrics } from "../types"; export declare class MetricsManager { private redis; private cachePrefix; private metrics; private cacheEnabled; private debug; constructor(redis: Redis | undefined, cachePrefix: string, metrics: typeof DEFAULT_METRICS, cacheEnabled: boolean, debug: boolean); private getConnectionKey; getServicesMetrics(services: ServiceHealth[]): Promise<Map<string, ServiceMetrics>>; incrementConnections(serviceId: string): Promise<void>; decrementConnections(serviceId: string): Promise<void>; updateSelectionMetrics(serviceId: string): Promise<void>; getSelectionMetrics(serviceId: string): Promise<ServiceMetrics | null>; }