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

package.dist.src.config.middleware.experimental-event-loop-perf-middleware.js Maven / Gradle / Ivy

The newest version!
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExperimentalEventLoopPerformanceMetricsMiddleware = void 0;
const perf_hooks_1 = require("perf_hooks");
class ExperimentalEventLoopPerformanceMetricsMiddlewareRequestHandler {
    onRequestBody(request) {
        return Promise.resolve(request);
    }
    onRequestMetadata(metadata) {
        return Promise.resolve(metadata);
    }
    onResponseMetadata(metadata) {
        return Promise.resolve(metadata);
    }
    onResponseBody(response) {
        return Promise.resolve(response);
    }
    onResponseStatus(status) {
        return Promise.resolve(status);
    }
}
/**
 * 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.
 */
class ExperimentalEventLoopPerformanceMetricsMiddleware {
    constructor(loggerFactory) {
        this.metricsLogInterval = 1000;
        this.eventLoopDelayInterval = 20;
        this.isLoggingStarted = false;
        // this is typed as any because JS returns a number for intervalId but
        // TS returns a NodeJS.Timeout.
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        this.intervalId = null; // Store the interval ID
        this.logger = loggerFactory.getLogger(this);
    }
    init() {
        if (!this.isLoggingStarted) {
            this.isLoggingStarted = true;
            this.startLogging();
        }
    }
    startLogging() {
        this.eldMonitor = (0, perf_hooks_1.monitorEventLoopDelay)({
            resolution: this.eventLoopDelayInterval,
        });
        this.eldMonitor.enable();
        this.elu = perf_hooks_1.performance.eventLoopUtilization();
        this.intervalId = setInterval(() => {
            this.elu = perf_hooks_1.performance.eventLoopUtilization(this.elu);
            const metrics = {
                eventLoopUtilization: this.elu.utilization,
                eventLoopDelayMean: this.eldMonitor.mean,
                eventLoopDelayMin: this.eldMonitor.min,
                eventLoopDelayP50: this.eldMonitor.percentile(50),
                eventLoopDelayP75: this.eldMonitor.percentile(75),
                eventLoopDelayP90: this.eldMonitor.percentile(90),
                eventLoopDelayP95: this.eldMonitor.percentile(95),
                eventLoopDelayP99: this.eldMonitor.percentile(99),
                eventLoopDelayMax: this.eldMonitor.max,
                timestamp: Date.now(),
            };
            this.logger.info(JSON.stringify(metrics));
            this.eldMonitor.reset();
        }, this.metricsLogInterval);
    }
    onNewRequest() {
        return new ExperimentalEventLoopPerformanceMetricsMiddlewareRequestHandler();
    }
    close() {
        if (this.intervalId !== null) {
            this.logger.debug('Stopping event loop metrics logging.');
            // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
            clearInterval(this.intervalId);
            this.intervalId = null;
            this.isLoggingStarted = false;
            this.logger.debug('Event loop metrics logging stopped.');
        }
    }
}
exports.ExperimentalEventLoopPerformanceMetricsMiddleware = ExperimentalEventLoopPerformanceMetricsMiddleware;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhwZXJpbWVudGFsLWV2ZW50LWxvb3AtcGVyZi1taWRkbGV3YXJlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2NvbmZpZy9taWRkbGV3YXJlL2V4cGVyaW1lbnRhbC1ldmVudC1sb29wLXBlcmYtbWlkZGxld2FyZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFPQSwyQ0FJb0I7QUF3RHBCLE1BQU0sK0RBQStEO0lBR25FLGFBQWEsQ0FBQyxPQUEwQjtRQUN0QyxPQUFPLE9BQU8sQ0FBQyxPQUFPLENBQUMsT0FBTyxDQUFDLENBQUM7SUFDbEMsQ0FBQztJQUVELGlCQUFpQixDQUFDLFFBQTRCO1FBQzVDLE9BQU8sT0FBTyxDQUFDLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQztJQUNuQyxDQUFDO0lBRUQsa0JBQWtCLENBQ2hCLFFBQTRCO1FBRTVCLE9BQU8sT0FBTy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