package.dist.src.config.middleware.experimental-event-loop-perf-middleware.d.ts Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk Show documentation
Show all versions of sdk Show documentation
Client SDK for Momento services
The newest version!
import { Middleware, MiddlewareRequestHandler } from './middleware';
import { MomentoLoggerFactory } from '@gomomento/sdk-core';
/**
* This middleware enables event-loop performance metrics.It runs a periodic task specified by metricsLogInterval
* to gather various event-loop metrics that can be correlated with the overall application's performance. This is
* particularly helpful to analyze and correlate resource contention with higher network latencies.
*
* See {@link StateMetrics} for each heuristic/metric and their description.
*/
export declare class ExperimentalEventLoopPerformanceMetricsMiddleware implements Middleware {
private readonly metricsLogInterval;
private readonly eventLoopDelayInterval;
private eldMonitor;
private elu;
private isLoggingStarted;
private intervalId;
private readonly logger;
constructor(loggerFactory: MomentoLoggerFactory);
init(): void;
private startLogging;
onNewRequest(): MiddlewareRequestHandler;
close(): void;
}