Gave the collector code a good scrub.#7961
Conversation
- Removed overkill double-checked locking for more code clarity. - Reorganized code fragments to group common pieces. - Defer ticker.Stop() for extra sanity. - Renamed error to reflect true meaning. - Removed unnecessary function indirection. - Used fake tickProvider in the last missing test to push test runtimes from 3s to ~15ms.
knative-prow-robot
left a comment
There was a problem hiding this comment.
@markusthoemmes: 0 warnings.
Details
In response to this:
Proposed Changes
- Removed overkill double-checked locking for more code clarity.
- Reorganized code fragments to group common pieces.
- Defer ticker.Stop() for extra sanity.
- Renamed error to reflect true meaning.
- Removed unnecessary function indirection.
- Used fake tickProvider in the last missing test to push test runtimes from 3s to ~15ms.
Release Note
NONE/assign @julz @vagababov
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: markusthoemmes The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
| } | ||
| key := types.NamespacedName{Namespace: metric.Namespace, Name: metric.Name} | ||
|
|
||
| c.collectionsMutex.RLock() |
There was a problem hiding this comment.
Before y'all yell at me: The maximum concurrency at this piece of code is 2. I think I only put this in here because doubly-checked locking was my favorite toy at the time. 😅
|
The following is the coverage report on the affected files.
|
|
/lgtm |
Proposed Changes
Release Note
/assign @julz @vagababov