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

Move Counters into Latest #3748

Merged
merged 4 commits into from
Mar 11, 2020
Merged

Move Counters into Latest #3748

merged 4 commits into from
Mar 11, 2020

Conversation

bboreham
Copy link
Collaborator

The only place Counters are used is in rendering, for the number of nodes under a topology, so the overhead of holding a unique data structure in every Node is unwarranted.

Counters are not set in the probe, so we don't need any backwards-compatibility in report decoding. Similarly they are not set until after all nodes are merged, so we don't need that logic.
(It was a bug if we did use it - merges are supposed to be idempotent).

Copy link
Contributor

@fbarl fbarl left a comment

Choose a reason for hiding this comment

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

Very nice reduction 💯

I left some minor suggestions, otherwise feel free to merge!

@bboreham bboreham force-pushed the move-counters-to-latest branch from a1b1bc1 to cf37b0d Compare March 8, 2020 20:34
The only place Counters are used is in rendering, for the number of
nodes under a topology, so the overhead of holding a unique data
structure in every Node is unwarranted.

Counters are not set in the probe, so we don't need any
backwards-compatibility in report decoding. Similarly they are not set
until after all nodes are merged, so we don't need that logic.
@bboreham bboreham force-pushed the move-counters-to-latest branch from cf37b0d to c800ed1 Compare March 10, 2020 12:32
@bboreham
Copy link
Collaborator Author

It turned out this needed more work because ContainerHostnameRenderer was relying on the additive merge behaviour, also this wasn't being checked in unit tests.
So I extended the unit tests to check counts and to cover the case where the count is not 1.
Then re-did ContainerHostnameRenderer as a Renderer so it didn't need additive merge.

It was relying on the previous behaviour of Merge() adding up counters.
@bboreham bboreham force-pushed the move-counters-to-latest branch from c800ed1 to ffa9071 Compare March 10, 2020 13:19
@bboreham bboreham merged commit f66e91e into master Mar 11, 2020
@bboreham bboreham deleted the move-counters-to-latest branch March 11, 2020 21:14
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.

2 participants