feature(dashboard): refactor overview
fix(lint)
This commit is contained in:
committed by
Carl-Gerhard Lindesvärd
parent
b035c0d586
commit
a1eb4a296f
@@ -1,6 +1,12 @@
|
||||
import client from 'prom-client';
|
||||
|
||||
import { botBuffer, db, eventBuffer, profileBuffer } from '@openpanel/db';
|
||||
import {
|
||||
botBuffer,
|
||||
db,
|
||||
eventBuffer,
|
||||
profileBuffer,
|
||||
sessionBuffer,
|
||||
} from '@openpanel/db';
|
||||
import { cronQueue, eventsQueue, sessionsQueue } from '@openpanel/queue';
|
||||
|
||||
const Registry = client.Registry;
|
||||
@@ -98,3 +104,14 @@ register.registerMetric(
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
register.registerMetric(
|
||||
new client.Gauge({
|
||||
name: `buffer_${sessionBuffer.name}_count`,
|
||||
help: 'Number of unprocessed sessions',
|
||||
async collect() {
|
||||
const metric = await sessionBuffer.getBufferSize();
|
||||
this.set(metric);
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user