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

Refactor metrics statics into free fns #633

Merged
merged 1 commit into from
Oct 27, 2022
Merged

Conversation

XAMPPRocky
Copy link
Collaborator

This wraps a function around the metric static variables, this is to ensure at compile-time that all metrics always have the correct number of label values, previously there were one or two cases where one label was missing.

src/metrics.rs Outdated Show resolved Hide resolved
crate::metrics::PACKETS_DROPPED
.with_label_values(&[crate::metrics::READ_DIRECTION_LABEL, id])
.inc();
crate::metrics::packets_dropped(crate::metrics::READ, id).inc();
Copy link
Member

Choose a reason for hiding this comment

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

Love this. Much better 👍🏻

@quilkin-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: ce3b4ece-64d1-40be-9d25-43316e5a862e

The following development images have been built, and will exist for the next 30 days:

To build this version:

git fetch [email protected]:googleforgames/quilkin.git pull/633/head:pr_633 && git checkout pr_633
cargo build

@markmandel markmandel merged commit facf875 into main Oct 27, 2022
@markmandel markmandel deleted the ep/refactor-metrics branch October 27, 2022 17:21
@markmandel markmandel added the kind/cleanup Refactoring code, fixing up documentation, etc label Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Refactoring code, fixing up documentation, etc size/m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants