"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const calc_1 = require("../utils/calc");
async function default_1(fastify) {
    fastify.decorate('mappedMetrics', {});
    fastify.decorate('metricsInterval', setInterval(() => (0, calc_1.calculateMetrics)(fastify), 1000));
    fastify.addHook('onClose', async () => {
        fastify.log.info('Closing the backend...');
        clearInterval(fastify.metricsInterval);
    });
}
//# sourceMappingURL=metrics.js.map