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 DNS name mapping from endpoint to report #3061

Merged
merged 2 commits into from
Feb 20, 2018
Merged

Conversation

bboreham
Copy link
Collaborator

@bboreham bboreham commented Feb 7, 2018

Fixes #3058

If the probe sees many TCP sockets on a host, it will repeat the same address information on each endpoint. Moving it to report level saves all this repetition. Also Sets is an expensive data structure; for the DNS mapping I used a straightforward map, similar to Topology.Nodes.

I see about a 6% reduction in JSON file size, on Weave Cloud production reports.

The mapping is used as a mapping from IP address to name, and the current implementation encodes it the same way, but to me it seems more logical to send it as a mapping from name to address. Probably that doesn't matter.

I considered moving DNSFirstMatch from render to report, to collect all the behaviour together. However the decisions made are somewhat related to rendering, so I left it.

@@ -73,7 +73,7 @@ func newConnectionCounters() *connectionCounters {
return &connectionCounters{counted: map[string]struct{}{}, counts: map[connection]int{}}
}

func (c *connectionCounters) add(outgoing bool, localNode, remoteNode, localEndpoint, remoteEndpoint report.Node) {
func (c *connectionCounters) add(rpt report.Report, outgoing bool, localNode, remoteNode, localEndpoint, remoteEndpoint report.Node) {

This comment was marked as abuse.

report/report.go Outdated
@@ -469,6 +475,37 @@ func (r Report) upgradeNamespaces() Report {
return r
}

// Note in-place modification of Endpoint.Nodes

This comment was marked as abuse.

This comment was marked as abuse.

report/report.go Outdated
reverseNames, foundR := endpoint.Sets.Lookup(ReverseDNSNames)
if ok && (foundS || foundR) {
// Add address and names to report-level data - we assume
// all endpoints with the same address have equally good data

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

@weaveworks weaveworks deleted a comment from rade Feb 7, 2018
@bboreham
Copy link
Collaborator Author

I made the requested changes and rebased. Also moved DNSFirstMatch since it looks a lot more like a method on DNSRecords now.

@bboreham bboreham merged commit 6cc2026 into master Feb 20, 2018
@bboreham bboreham deleted the dns-on-report branch September 13, 2019 15:34
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