Skip to content

Commit

Permalink
Add better per job metrics and UI (#603)
Browse files Browse the repository at this point in the history
  • Loading branch information
pushchris authored Jan 4, 2025
1 parent 27a457b commit b921fef
Show file tree
Hide file tree
Showing 12 changed files with 445 additions and 292 deletions.
12 changes: 11 additions & 1 deletion apps/platform/src/organizations/OrganizationController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,17 @@ router.get('/performance/jobs', async ctx => {
})

router.get('/performance/jobs/:job', async ctx => {
ctx.body = await App.main.stats.list(ctx.params.job)
const jobName = ctx.params.job
ctx.body = [
{
label: 'added',
data: await App.main.stats.list(jobName),
},
{
label: 'completed',
data: await App.main.stats.list(`${jobName}:completed`),
},
]
})

router.get('/performance/failed', async ctx => {
Expand Down
1 change: 1 addition & 0 deletions apps/platform/src/queue/Queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export default class Queue {

async completed(job: EncodedJob) {
logger.trace(job, 'queue:job:completed')
await App.main.stats.increment(`${job.name}:completed`)
}

async start() {
Expand Down
Loading

0 comments on commit b921fef

Please sign in to comment.