0
0
Fork 0

Convert the streaming server to ESM (#29389)

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Renaud Chaput 2024-02-27 15:59:20 +01:00 committed by GitHub
parent bc4c5ed918
commit 036f5a05e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 65 additions and 78 deletions

View file

@ -1,6 +1,6 @@
// @ts-check
const metrics = require('prom-client');
import metrics from 'prom-client';
/**
* @typedef StreamingMetrics
@ -18,7 +18,7 @@ const metrics = require('prom-client');
* @param {import('pg').Pool} pgPool
* @returns {StreamingMetrics}
*/
function setupMetrics(channels, pgPool) {
export function setupMetrics(channels, pgPool) {
// Collect metrics from Node.js
metrics.collectDefaultMetrics();
@ -101,5 +101,3 @@ function setupMetrics(channels, pgPool) {
messagesSent,
};
}
exports.setupMetrics = setupMetrics;