Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.bridge.registerBridgeGauges(() => {
const now = Date.now() / 1000;
const remoteRoomsByAge = new PrometheusMetrics.AgeCounters();
const matrixRoomsByAge = new PrometheusMetrics.AgeCounters();
this.rooms.all.forEach((room) => {
remoteRoomsByAge.bump(now - room.RemoteATime!);
matrixRoomsByAge.bump(now - room.MatrixATime!);
});
const countAges = (users: QuickLRU) => {
const counts = new PrometheusMetrics.AgeCounters();
const snapshot = [...users.values()].filter((u) => u !== undefined && u.aTime! > 0);
for (const user of snapshot) {
counts.bump(now - user.aTime!);
}
return counts;
};
return {
const countAges = (users: QuickLRU) => {
const counts = new PrometheusMetrics.AgeCounters();
const snapshot = [...users.values()].filter((u) => u !== undefined && u.aTime! > 0);
for (const user of snapshot) {
counts.bump(now - user.aTime!);
}
return counts;
};
this.bridge.registerBridgeGauges(() => {
const now = Date.now() / 1000;
const remoteRoomsByAge = new PrometheusMetrics.AgeCounters();
const matrixRoomsByAge = new PrometheusMetrics.AgeCounters();
this.rooms.all.forEach((room) => {
remoteRoomsByAge.bump(now - room.RemoteATime!);
matrixRoomsByAge.bump(now - room.MatrixATime!);
});
const countAges = (users: QuickLRU) => {
const counts = new PrometheusMetrics.AgeCounters();
const snapshot = [...users.values()].filter((u) => u !== undefined && u.aTime! > 0);
for (const user of snapshot) {
counts.bump(now - user.aTime!);
}
return counts;
};