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

ccl/sqlproxyccl: add metrics to track the number of rebalance requests #79874

Merged

Conversation

jaylim-crl
Copy link
Collaborator

This commit addresses a TODO by adding metrics to track the number of rebalance
requests (total, queued, and running). The following metrics are added:

  • proxy.balancer.rebalance.running
  • proxy.balancer.rebalance.queued
  • proxy.balancer.rebalance.total

Release note: None

@jaylim-crl jaylim-crl requested review from a team as code owners April 13, 2022 02:25
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@jaylim-crl jaylim-crl requested review from jeffswenson and andy-kimball and removed request for a team April 13, 2022 02:25
@jaylim-crl jaylim-crl force-pushed the jay/220412-add-balancer-metrics branch from 9e3fa7a to 21043df Compare April 13, 2022 02:28
Copy link
Collaborator

@jeffswenson jeffswenson left a comment

Choose a reason for hiding this comment

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

LGTM! Nice work :)

pkg/ccl/sqlproxyccl/balancer/metrics.go Outdated Show resolved Hide resolved
This commit addresses a TODO by adding metrics to track the number of rebalance
requests (total, queued, and running). The following metrics are added:
- proxy.balancer.rebalance.running
- proxy.balancer.rebalance.queued
- proxy.balancer.rebalance.total

Release note: None
@jaylim-crl jaylim-crl force-pushed the jay/220412-add-balancer-metrics branch from 21043df to cb73631 Compare April 13, 2022 14:44
Copy link
Collaborator Author

@jaylim-crl jaylim-crl left a comment

Choose a reason for hiding this comment

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

TFTR!

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @andy-kimball)


pkg/ccl/sqlproxyccl/balancer/metrics.go, line 48 at r1 (raw file):

Previously, JeffSwenson (Jeff Swenson) wrote…

nit: (really nitty) name this NewMetrics() instead of MakeMetrics(). New is the most common prefix in go for factory functions.

Done. Thanks. Also, I believe CRDB has a convention of using NewX for something that returns a pointer, and MakeX for regular objects.

@jaylim-crl
Copy link
Collaborator Author

TFTR!

bors r=JeffSwenson

@craig
Copy link
Contributor

craig bot commented Apr 13, 2022

Build succeeded:

@craig craig bot merged commit ba9baca into cockroachdb:master Apr 13, 2022
@jaylim-crl jaylim-crl deleted the jay/220412-add-balancer-metrics branch April 13, 2022 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants