Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stats about job classes #1362

Closed
wants to merge 30 commits into from
Closed

Add stats about job classes #1362

wants to merge 30 commits into from

Conversation

arnaudlevy
Copy link
Contributor

Capture d’écran 2024-05-25 à 09 31 58

@bensheldon
Copy link
Owner

@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
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@bensheldon
Copy link
Owner

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

I would say:

  • Go for it 👍🏻
  • Please do it as a separate PR (nows the time because I'm working on the next major GoodJob upgrade and it would be ideal to get in any database migrations before that)
  • Store the column as a BigInt as like duration_ms on the good_job_executions table. I don't think we want to store a float.
  • Do it as a monotonic time (get the monotonic start as a Ruby variable and then calculate the total duration in milliseconds and store that)

@bensheldon
Copy link
Owner

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?

  • Chart config is ok 👍🏻
  • I'd like to call this page "Performance" rather than "Statistics" (🚧 Necessary)
  • The calculations must be done in the database, rather than by loading all the executions. (🚧 Necessary)
    • We should probably scope it by time ago (1 hour, 4 hours, 1 dday, etc.). When I've spiked on that in the past (but never made as much progress as you!) I had a drop-down that would set a paramter. But I would say just pick one for now and we can always go back and add more options in a later PR
  • I'd ideally like this to (eventually, ok in a follow-on PR) be a top level list of queues, that then could be drilled down on to job class.

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

@arnaudlevy
Copy link
Contributor Author

arnaudlevy commented May 29, 2024

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
Copy link
Contributor Author

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

@bensheldon
Copy link
Owner

@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
Copy link
Contributor

Hi @bensheldon!

The filters fix is now on this PR if you want: #1373 !

@SebouChu
Copy link
Contributor

@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
Copy link
Contributor

SebouChu commented Jul 5, 2024

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

@bensheldon
Copy link
Owner

bensheldon commented Jul 6, 2024

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 🎉

@bensheldon bensheldon closed this Jul 6, 2024
@arnaudlevy
Copy link
Contributor Author

Thanks @bensheldon, that's really cool!

@SebouChu
Copy link
Contributor

SebouChu commented Jul 6, 2024

Perfect, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants