diff options
author | Chocobozzz <me@florianbigard.com> | 2022-07-05 15:43:21 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-07-06 15:13:55 +0200 |
commit | 630d0a1bf5897fff203cb07e426223f55dcc882d (patch) | |
tree | 5e6fa9d26f3f21178a538bd1ac38fa0a3f4f228c /server/lib/job-queue/job-queue.ts | |
parent | 15b43b214eb37b05aa65aa8ef61fd0e6aa0b62d2 (diff) | |
download | PeerTube-630d0a1bf5897fff203cb07e426223f55dcc882d.tar.gz PeerTube-630d0a1bf5897fff203cb07e426223f55dcc882d.tar.zst PeerTube-630d0a1bf5897fff203cb07e426223f55dcc882d.zip |
Introduce experimental telemetry
Diffstat (limited to 'server/lib/job-queue/job-queue.ts')
-rw-r--r-- | server/lib/job-queue/job-queue.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/server/lib/job-queue/job-queue.ts b/server/lib/job-queue/job-queue.ts index ce24763f1..e55d2e7c2 100644 --- a/server/lib/job-queue/job-queue.ts +++ b/server/lib/job-queue/job-queue.ts | |||
@@ -285,6 +285,12 @@ class JobQueue { | |||
285 | return total | 285 | return total |
286 | } | 286 | } |
287 | 287 | ||
288 | async getStats () { | ||
289 | const promises = jobTypes.map(async t => ({ jobType: t, counts: await this.queues[t].getJobCounts() })) | ||
290 | |||
291 | return Promise.all(promises) | ||
292 | } | ||
293 | |||
288 | async removeOldJobs () { | 294 | async removeOldJobs () { |
289 | for (const key of Object.keys(this.queues)) { | 295 | for (const key of Object.keys(this.queues)) { |
290 | const queue = this.queues[key] | 296 | const queue = this.queues[key] |