fix(buffer): move to redis again 😅 but better

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-02-08 21:38:27 +01:00
parent 6fae06770c
commit ec8aaf24fb
13 changed files with 1098 additions and 637 deletions

View File

@@ -71,11 +71,7 @@ register.registerMetric(
name: `buffer_${eventBuffer.name}_count`,
help: 'Number of unprocessed events',
async collect() {
const metric = await db.eventBuffer.count({
where: {
processedAt: null,
},
});
const metric = await eventBuffer.getBufferSize();
this.set(metric);
},
}),
@@ -86,11 +82,7 @@ register.registerMetric(
name: `buffer_${profileBuffer.name}_count`,
help: 'Number of unprocessed profiles',
async collect() {
const metric = await db.profileBuffer.count({
where: {
processedAt: null,
},
});
const metric = await profileBuffer.getBufferSize();
this.set(metric);
},
}),
@@ -101,11 +93,7 @@ register.registerMetric(
name: `buffer_${botBuffer.name}_count`,
help: 'Number of unprocessed bot events',
async collect() {
const metric = await db.botEventBuffer.count({
where: {
processedAt: null,
},
});
const metric = await botBuffer.getBufferSize();
this.set(metric);
},
}),