mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
prom: reset task metrics
This commit is contained in:
1 parent
5bc336fc9c
commit
b3e975cf38
2 files changed
+2
-1
No files matched your search
@@ -51,6 +51,7 @@ createMetric(Gauge, 'hydro_task', 'taskcount', {
|
||||
const data = await taskColl.aggregate([
|
||||
{ $group: { _id: '$type', count: { $sum: 1 } } },
|
||||
]).toArray();
|
||||
this.reset();
|
||||
for (const line of data) {
|
||||
this.set({ type: line._id as unknown as string }, line.count);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/prom-client",
|
||||
"version": "0.0.3",
|
||||
"version": "0.0.4",
|
||||
"dependencies": {
|
||||
"prom-client": "^14.0.1"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user