bensheldon / good_job

Multithreaded, Postgres-based, Active Job backend for Ruby on Rails.
https://goodjob-demo.herokuapp.com/
MIT License
2.65k stars 195 forks source link

Latency charts and histograms for individual job classes #1411

Closed Earlopain closed 2 months ago

Earlopain commented 2 months ago

grafik

A bit for #1397 I guess.

I've moved some things around to something that I think makes sense for multiple charts (the one on the homepage and this one now).


Translations are machine-made and probably bad. I saw some existing german ones that talk about executions in the killing way and jobs in the employment way.

Earlopain commented 2 months ago

I also added a histogram for how long jobs take to execute, it looks like this: image

You can go there by following the link of each job on the performance landing page. I used the interval values that sidekiq does, seems good enough.

Earlopain commented 2 months ago

One other change: I failed to notice that some of the durations got rounded down to flat seconds in the chart labels. I think it's generally useful to show 1-10 seconds with one decimal place if applicable. For example, the performance index is a bit more useful in that range: grafik

Earlopain commented 2 months ago

Your change looks reasonable to me, I haven't even considered how the chart would handle this. I would say its fine but didn't check of course. The 404 is also an improvement.

I have some thoughts on how to improve this further as well. Like right now, its just 1 day of data and I can imagine a selection for ranges like last 1 hour, 1 week, etc. being useful as well but I didn't want to throw that all into one PR. Somehow making the individual bars of the histogram clickable and getting a list of jobs with their arguments that took that amount of time also sounds useful to me, or something else to surface slow jobs.

Haven't looked into that yet, I may make a PR for that in the future but who knows. When the muse strikes.