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 metrics of client #157

Closed
wants to merge 1 commit into from
Closed

Add metrics of client #157

wants to merge 1 commit into from

Conversation

An-DJ
Copy link
Contributor

@An-DJ An-DJ commented Jul 4, 2021

Add the following metrics:

  • pgagroal_client_active
  • pgagroal_client_wait

Close #156

@@ -159,6 +163,9 @@ pgagroal_worker(int client_fd, char* address, char** argv)
/* The slot may have been updated */
slot = client_io.slot;
}

pgagroal_prometheus_client_active_sub();
pgagroal_prometheus_client_wait_add();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand where you are coming from.

However, I don't think we need to put client shutdown into the client_wait category, since we are basically exiting shortly.

Hence we can remove client_wait_add() from here

@@ -242,6 +249,8 @@ pgagroal_worker(int client_fd, char* address, char** argv)
pgagroal_log_debug("client disconnect: %d", client_fd);
pgagroal_disconnect(client_fd);

pgagroal_prometheus_client_wait_sub();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Therefore we can move this to the else

@jesperpedersen
Copy link
Collaborator

Review my comments, squash, amend commit message with issue number, and force push

@jesperpedersen jesperpedersen added the enhancement Improvement to an existing feature label Jul 5, 2021
Add the following metrics:
* pgagroal_client_active
* pgagroal_client_wait

Close agroal#156
@An-DJ
Copy link
Contributor Author

An-DJ commented Jul 5, 2021

Review my comments, squash, amend commit message with issue number, and force push

Done

@jesperpedersen
Copy link
Collaborator

Thanks for your contribution !

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

Successfully merging this pull request may close these issues.

Add metrics of client
2 participants