-
Notifications
You must be signed in to change notification settings - Fork 16
refactor: Make ResultsFulfillerMetrics injectable for test isolation #3348
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
Conversation
kungfucraig
left a comment
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.
@kungfucraig reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @georgi and @Marco-Premier)
src/main/kotlin/org/wfanet/measurement/edpaggregator/resultsfulfiller/ResultsFulfiller.kt line 106 at r1 (raw file):
private val fulfillerSelector: FulfillerSelector, private val responsePageSize: Int? = null, private val metrics: ResultsFulfillerMetrics = ResultsFulfillerMetrics.create(),
I'd prefer if we didn't default this. It causes long-term maintenance headaches.
georgi
left a comment
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.
@georgi reviewed 1 of 3 files at r1, 4 of 4 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @kungfucraig and @Marco-Premier)
src/main/kotlin/org/wfanet/measurement/edpaggregator/resultsfulfiller/ResultsFulfiller.kt line 106 at r1 (raw file):
Previously, kungfucraig (Craig Wright) wrote…
I'd prefer if we didn't default this. It causes long-term maintenance headaches.
Done.
Convert ResultsFulfillerMetrics from an object to a class that accepts a Meter parameter. This allows tests to inject their own meter instance for better test isolation and prevents test pollution from shared global state. - Convert ResultsFulfillerMetrics from object to class - Add create() factory method for default Instrumentation meter - Add metrics parameter to ResultsFulfiller constructor - Update ResultsFulfillerAppRunner to create metrics instance
920f2c7 to
32ef289
Compare
32ef289 to
a155516
Compare
kungfucraig
left a comment
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.
@kungfucraig reviewed 6 files and all commit messages, and resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @Marco-Premier).
Convert ResultsFulfillerMetrics from an object to a class that accepts a Meter parameter. This allows tests to inject their own meter instance for better test isolation and prevents test pollution from shared global state.