diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2020-01-30 04:37:25 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-30 04:37:25 +0900 |
| commit | f6154dc0af1a0d65819e87240f4385f9573095cb (patch) | |
| tree | 699a5ca07d6727b7f8497d4769f25d6d62f94b5a /src/daemons/queue-stats.ts | |
| parent | Add Event activity-type support (#5785) (diff) | |
| download | misskey-f6154dc0af1a0d65819e87240f4385f9573095cb.tar.gz misskey-f6154dc0af1a0d65819e87240f4385f9573095cb.tar.bz2 misskey-f6154dc0af1a0d65819e87240f4385f9573095cb.zip | |
v12 (#5712)
Co-authored-by: MeiMei <30769358+mei23@users.noreply.github.com>
Co-authored-by: Satsuki Yanagi <17376330+u1-liquid@users.noreply.github.com>
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(); |