diff options
Diffstat (limited to 'src/daemons/queue-stats.ts')
| -rw-r--r-- | src/daemons/queue-stats.ts | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/src/daemons/queue-stats.ts b/src/daemons/queue-stats.ts index e560354c74..288e855ae9 100644 --- a/src/daemons/queue-stats.ts +++ b/src/daemons/queue-stats.ts @@ -1,25 +1,22 @@ -import * as Deque from 'double-ended-queue'; import Xev from 'xev'; -import { deliverQueue, inboxQueue, dbQueue, objectStorageQueue } from '../queue'; +import { deliverQueue, inboxQueue } from '../queue'; const ev = new Xev(); -const interval = 3000; +const interval = 10000; /** * Report queue stats regularly */ export default function() { - const log = new Deque<any>(); + const log = [] as any[]; ev.on('requestQueueStatsLog', x => { - ev.emit(`queueStatsLog:${x.id}`, log.toArray().slice(0, x.length || 50)); + ev.emit(`queueStatsLog:${x.id}`, log.slice(0, x.length || 50)); }); let activeDeliverJobs = 0; let activeInboxJobs = 0; - let activeDbJobs = 0; - let activeObjectStorageJobs = 0; deliverQueue.on('global:active', () => { activeDeliverJobs++; @@ -29,19 +26,9 @@ export default function() { activeInboxJobs++; }); - dbQueue.on('global:active', () => { - activeDbJobs++; - }); - - objectStorageQueue.on('global:active', () => { - activeObjectStorageJobs++; - }); - async function tick() { const deliverJobCounts = await deliverQueue.getJobCounts(); const inboxJobCounts = await inboxQueue.getJobCounts(); - const dbJobCounts = await dbQueue.getJobCounts(); - const objectStorageJobCounts = await objectStorageQueue.getJobCounts(); const stats = { deliver: { @@ -56,18 +43,6 @@ export default function() { waiting: inboxJobCounts.waiting, delayed: inboxJobCounts.delayed }, - db: { - activeSincePrevTick: activeDbJobs, - active: dbJobCounts.active, - waiting: dbJobCounts.waiting, - delayed: dbJobCounts.delayed - }, - objectStorage: { - activeSincePrevTick: activeObjectStorageJobs, - active: objectStorageJobCounts.active, - waiting: objectStorageJobCounts.waiting, - delayed: objectStorageJobCounts.delayed - }, }; ev.emit('queueStats', stats); @@ -77,8 +52,6 @@ export default function() { activeDeliverJobs = 0; activeInboxJobs = 0; - activeDbJobs = 0; - activeObjectStorageJobs = 0; } tick(); |