bensheldon / good_job

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

Add stats about job classes #1362

Closed arnaudlevy closed 1 week ago

arnaudlevy commented 1 month ago
Capture d’écran 2024-05-25 à 09 31 58
bensheldon commented 1 month ago

@arnaudlevy I'm excited where you're going with this! fyi, there is some discussion in #438 about such a feature. Let me know when you'd like me to review it and give you feedback.

arnaudlevy commented 1 month ago

Hey @bensheldon, glad you like it! Maybe what I did there could be a first step. Tell me what you think about the names, so I can walk in your steps and adjust. I put all chart config back in ruby, is that ok?

arnaudlevy commented 1 month ago

@bensheldon what do you think about denormalizing runtime_latency? It would be easier to manipulate as a field in the table.

bensheldon commented 1 month ago

@arnaudlevy there's a little about storing the latency in #1053.

I would say:

bensheldon commented 1 month ago

Tell me what you think about the names, so I can walk in your steps and adjust. I put all chart config back in ruby, is that ok?

Sorry if that's a lot. Only two changes are truly necessary I think (calculate in DB, rename to Performance)

arnaudlevy commented 1 month ago

Hey @bensheldon ! Renaming to performance was easy, it's done. I did some SQL limits (start / end), but i'm not too sure what you think about. Here is the current graph (very suboptimal, as every execution is shown).

Capture d’écran 2024-05-29 à 07 37 10

The idea, for us, is to spot the "slow elephants", the ones that are really long. What do you think?

arnaudlevy commented 1 month ago

Don't know if you noticed @bensheldon but @SebouChu added a fix to the filters

bensheldon commented 1 month ago

@SebouChu added a fix to the filters

Nice! Could you break that out into its own PR?

On that same note, I'd like to isolate this PR just down to the PerformancesController#index controller/view. That would help me really isolate down this feature and we can work on making it performant/possible. Once we get that done/shipped, then focus on additional features for drilling down (don't throw it away! I just want to make it easier to move forward the first piece)

SebouChu commented 1 month ago

Hi @bensheldon!

The filters fix is now on this PR if you want: https://github.com/bensheldon/good_job/pull/1373 !

SebouChu commented 1 month ago

@bensheldon Just finished adjustments here, mainly having one SQL request for the Performances#index, and focusing on the page only.

Right now, the request gets the execution duration with EXTRACT(EPOCH FROM (finished_at - created_at)), but with #1374, it will be simplified so feel free to merge this one so that I can adjust the SQL request here!

SebouChu commented 1 week ago

@bensheldon I made the adjustment in the Performance Controller to use duration instead of extracting EPOCH, should be good now!

bensheldon commented 1 week ago

I had to open a new PR (#1388) in order to push up changes to it (it seems like when a PR is opened from a branch named main I'm unable to push changes to it 🤷🏻). It looks great and I'm about to merge it 🎉

arnaudlevy commented 1 week ago

Thanks @bensheldon, that's really cool!

SebouChu commented 1 week ago

Perfect, thanks!