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

Simplify some renderers #3747

Merged
merged 4 commits into from
Feb 25, 2020
Merged

Simplify some renderers #3747

merged 4 commits into from
Feb 25, 2020

Conversation

bboreham
Copy link
Collaborator

ContainerImageRenderer: Crunch a Map and Reduce into a single Renderer that has the same function.

ContainerHostnameRenderer: The second half of the render added all the same nodes, except for
those with no Docker image information, so we could show a figure for those filtered out on that basis. This just isn't worth the effort.

And remove unused parameterisation of containerWithImageNameRenderer

Crunch a Map and Reduce into a single Renderer that has the same function.
The second half of the render added all the same nodes, except for
those with no Docker image information, so we could show a figure for
those filtered out on that basis.

This just isn't worth the effort.
ContainerWithImageNameRenderer,
),
// Grab *all* the hostnames, so we can count the number which were empty
// for accurate stats.
Copy link
Contributor

Choose a reason for hiding this comment

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

Where would these stats be displayed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Bottom-left of the screen, like "21 nodes (119 filtered)"

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok cool. That information's been misleading and incorrect at times for container topologies so I'm ok seeing it removed.

Looking at the UI code, it seems it's already robust enough to not display filtered nodes count if it's not provided so probably nothing will need to be updated there 👍

// Grab *all* the hostnames, so we can count the number which were empty
// for accurate stats.
MakeMap(
MapToEmpty,
Copy link
Contributor

Choose a reason for hiding this comment

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

After removing it from here, this method is not used anymore so feel free to remove it from container.go.

// ContainerImageRenderer is a Renderer which produces a renderable container
// image graph by merging the container graph and the container image topology.
// ContainerImageRenderer produces a graph where each node is a container image
// with the original containers as children
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 Thanks for clarity!

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.

Nice one! 👌

Left only some minor comments, it seems that the test coverage for this piece of logic is already decent, did you also do some manual testing?

Do you expect a significant performance improvement or was this PR more about simplifying the code?

@bboreham
Copy link
Collaborator Author

I am yak-shaving towards a significant performance improvement; this one piece doesn't do much but it helps to simplify the problem.

@bboreham bboreham merged commit b07bfb2 into master Feb 25, 2020
@bboreham bboreham deleted the simplify-renderers branch February 25, 2020 11:07
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