All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.src.config.middleware.experimental-garbage-collection-middleware.d.ts Maven / Gradle / Ivy

The newest version!
import { Middleware, MiddlewareRequestHandler } from './middleware';
import { MomentoLoggerFactory } from '@gomomento/sdk-core';
/**
 * This middleware enables garbage collection metrics. It subscribers to a GC performance observer provided by
 * node's built-in performance hooks, and logs key GC events. A sample log looks like:
 *
 * {
 *     "entryType": "gc",
 *     "startTime": 8221.879917,
 *     "duration": 2.8905000016093254,  <-- most important field to analyze for stop the world events, measured in milliseconds.
 *     "detail": {
 *         "kind": 4,  <-- constant for NODE_PERFORMANCE_GC_MAJOR. `MAJOR` events might point to GC events causing long delays.
 *         "flags": 32
 *     },
 *     "timestamp": 1710300309368
 * }
 */
export declare class ExperimentalGarbageCollectionPerformanceMetricsMiddleware implements Middleware {
    private readonly logger;
    private readonly gcObserver;
    constructor(loggerFactory: MomentoLoggerFactory);
    onNewRequest(): MiddlewareRequestHandler;
    close(): void;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy