Commit Graph

61 Commits

Author SHA1 Message Date
Tom Wilkie
7fb1a98eca Update detail node logic to deal with connection directionality; also correctly merge edge metadata for pseudo nodes. 2015-08-19 10:21:01 +00:00
Tom Wilkie
60d1b503c1 Deal with directed edges in the rest of the codebase. 2015-08-19 10:17:31 +00:00
Tom Wilkie
8c4bbdae8c Show how many containers have been grouped together under an image 2015-08-18 12:47:44 +00:00
Peter Bourgon
e1f7752a34 Split PacketCount to Egress and Ingress
Also, 1 packet may be counted in N topologies, so you can't rely on the
sum of all packet counts across topologies having any relation to the
sampling data.
2015-08-03 14:58:41 +02:00
Peter Bourgon
0aadf6447b Revert to correct edge construction
Another implicit invariant in the data model is that edges are always of the
form (local -> remote). That is, the source of an edge must always be a node
that originates from within Scope's domain of visibility. This was evident by
the presence of ingress and egress fields in edge/aggregate metadata.

When building the sniffer, I accidentally and incorrectly violated this
invariant, by constructing distinct edges for (local -> remote) and (remote ->
local), and collapsing ingress and egress byte counts to a single scalar. I
experienced a variety of subtle undefined behavior as a result. See #339.

This change reverts to the old, correct methodology. Consequently the sniffer
needs to be able to find out which side of the sniffed packet is local v.
remote, and to do that it needs access to local networks. I moved the
discovery from the probe/host package into probe/main.go.

As part of that work I discovered that package report also maintains its own,
independent "cache" of local networks. Except it contains only the (optional)
Docker bridge network, if it's been populated by the probe, and it's only used
by the report.Make{Endpoint,Address}NodeID constructors to scope local
addresses. Normally, scoping happens during rendering, and only for pseudo
nodes -- see current LeafMap Render localNetworks. This is pretty convoluted
and should be either be made consistent or heavily commented.
2015-08-03 10:55:59 +02:00
Peter Bourgon
b9afa67ad6 gopacket-based traffic sniffing 2015-08-03 10:55:59 +02:00
Peter Bourgon
3dd59c8b9b Fixes to NodeMetadata
NewNodeMetadata -> MakeNodeMetadata. It doesn't return a pointer, so
Make is more idiomatic.

Invoke MakeNodeMetadata when necessary. The zero value for a
NodeMetadata is no longer valid.

Split MakeNodeMetadata to two constructors. MakeNodeMetadata when you
don't have anything to prepopulate; MakeNodeMetadataWith when you do.

Also, a fix to the tests in app. We unmarshal a RenderableNode struct,
which has a JSON-ignored NodeMetadata field. The zero value is invalid,
so we need to fix that before performing comparisons.
2015-07-30 17:20:44 +02:00
Peter Bourgon
a565acc871 Unbreak the build 2015-07-22 14:26:09 +01:00
Tom Wilkie
14470aa107 Use container name (minus version) as id in containers-by-image view.
Also:
- build a custom URL matcher to cope with container image names having a encoded forward slash in them.
- escape node ids in the UI when constructing URLs.
- add a test which fetches all the nodes of all topologies, and update report fixture to have slash in container image names.
2015-07-01 12:53:47 +00:00
Tom Wilkie
eb250ecb7c Trim whitespace from process names
This causes detailed node lookups for the grouped-by-process-name view to fail.  Also, add a test for process walker trimmming whitespace, and a test the process-by-name view gives the right result.
2015-06-24 14:01:17 +00:00
Tom Wilkie
416f56c3cc Only have a single report fixture
- Move render.Rpt to test.Report
- Remove report/report_fixture_test.go; it was unused
- Remove report fixture in app/ and make tests use test.Report
- Move expected outputs into render/expected, so they can be reused
2015-06-24 09:51:29 +00:00