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 database connection pool details to Process state #1014

Closed
bensheldon opened this issue Jul 19, 2023 · 3 comments
Closed

Add database connection pool details to Process state #1014

bensheldon opened this issue Jul 19, 2023 · 3 comments

Comments

@bensheldon
Copy link
Owner

It might be helpful to provide a snapshot of the database connection pool settings and usage to the Process state.

For the database used by GoodJob (e.g. take it off the GoodJob::Process connection):

  • Size of the database connection pool
  • Number of active connections being used right now
@dixpac
Copy link
Contributor

dixpac commented Jul 25, 2023

@bensheldon did I understand this correctly:

You want to this information insideGoodJob::Process#current_state

Something like this:

    def self.ns_current_state
      {
        ...
        db_conection_pool_size: connection_pool.size,
        db_connection_pool_busy: connection_pool.connections.count(&:in_use?)
      }
    end

For the "Size of the database connection pool" do you want

  • connection_pool.size - Total capacity of the connection pool
  • connection_pool.connections.size - Total number of opened connections (idle or in_use)

@bensheldon
Copy link
Owner Author

@dixpac that looks perfect!

One naming request: what do you think of "active" instead of "busy"?

@dixpac
Copy link
Contributor

dixpac commented Jul 25, 2023

Awesome!
I'll submit PR then

Agree about the naming 🤘🏽

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

No branches or pull requests

2 participants