-
Notifications
You must be signed in to change notification settings - Fork 458
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
Reduce the amount of duplicate code in per-dataflow-worker metrics #7690
Reduce the amount of duplicate code in per-dataflow-worker metrics #7690
Conversation
One thing this requires is to de-strictify the rejection of missing_docs on the dataflow crate, until the PR at Soft/enum-kinds#3 goes in. |
add0492
to
30b1298
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is sooo good! Tyvm!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome!
7cbcb6e
to
82d57e7
Compare
By combining enum_kinds and num_enum, we can change the worker command representation to be an array of counters & values by which we increment them. That reduces the number of names we have to duplicate in code, and requires one fewer match statement on Command variants. It also gets rid of some metrics that were represented but never got incremented.
82d57e7
to
8dfab6a
Compare
This PR reduces the number of duplicate names you have to type if you introduce a
Command
to the dataflow server, and reduces the number of metrics that are present but never get updated. We do this by making the cache/counters live on an array and index that array by the Command kind that was processed.