this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove dead code in metrics

alice ff54152d 72df0b40

+2 -27
+2 -27
packages/backend/src/lib/metrics.ts
··· 1 - import { monitorPgClient, monitorPgPool } from '@christiangalsterer/node-postgres-prometheus-exporter'; 1 + import { monitorPgPool } from '@christiangalsterer/node-postgres-prometheus-exporter'; 2 2 import express from 'express'; 3 3 import { Counter, Gauge, Histogram, Registry, collectDefaultMetrics } from 'prom-client'; 4 4 5 5 import logger from './logger.js'; 6 - import { db, pool } from './postgres.js'; 6 + import { pool } from './postgres.js'; 7 7 8 8 const register = new Registry(); 9 9 collectDefaultMetrics({ register }); ··· 72 72 registers: [register], 73 73 }); 74 74 75 - // monitor the pg.Client 76 - // monitorPgClient(db.getClient(), register) 77 - 78 - // monitor the pg.Pool 79 75 monitorPgPool(pool, register); 80 76 81 77 let postsLastInterval = 0; ··· 90 86 totalEmojis.inc(count); 91 87 emojisLastInterval += count; 92 88 } 93 - 94 - // export function setTopEmojisAll(topEmojis: { emoji: string; count: number }[]) { 95 - // topEmojisAll.reset(); 96 - 97 - // topEmojis.forEach(({ emoji, count }) => { 98 - // topEmojisAll.set({ emoji }, count); 99 - // }); 100 - // } 101 - 102 - // export function setTopEmojisPerLanguage( 103 - // language: string, 104 - // topEmojis: { emoji: string; count: number }[], 105 - // ) { 106 - // // Clear existing metrics for the language 107 - // // Note: Prometheus does not support deleting specific label combinations directly. 108 - // // This implementation assumes that the setTopEmojisPerLanguage is called with the complete top list each time. 109 - 110 - // topEmojis.forEach(({ emoji, count }) => { 111 - // topEmojisPerLanguage.set({ language, emoji }, count); 112 - // }); 113 - // } 114 89 115 90 setInterval(() => { 116 91 postsPerSecond.set(postsLastInterval);