16 Commits

Author SHA1 Message Date
Bryan Boreham
f44f8806cd Add a test that checks if reports with data round-trip
Previously the only roundtrip test was for an empty report.
This test has fake data similar to that found in real reports.
'Metrics' does not round-trip exactly, so a DeepEqual workaround is
added for that.
2018-02-26 10:52:50 +00:00
Bryan Boreham
cb6edfeec1 Set 'omitempty' on Node Adjacency
Looks like an omission
2018-02-07 13:39:54 +00:00
Matthias Radestock
315b05062f remove vestiges of edge metadata from comments 2017-12-17 18:38:36 +00:00
Matthias Radestock
e93b69cf10 remove Node.Edges
It is unused and none of the adjacency mapping code in the renderer
takes any notice of it. Removing this shrinks the report size.

Edges were introduced in #838. At the time we had an experimental
packet sniffer under experimental/sniff/sniffer.go. That got removed
in #1646.

We can resurrect this if we ever decide to add meta data to edges.
2017-12-17 13:28:22 +00:00
Matthias Radestock
9dc50b5202 refactor: hide "empty set" constants
They are an implementation detail.
2017-07-03 01:26:22 +01:00
Jonathan Lange
e8085b01b6 Use 'common' library 2016-12-07 11:22:38 +00:00
Krzesimir Nowak
9e092f1a4a Switch to LatestMap-style node controls
This allows plugins to add controls to nodes that already have some
controls set by other plugin. Previously only the last plugin that
sets the controls in the node would have its controls visible. That
was because of NodeControls' Merge function that actually weren't
merging data from two inputs, but rather returning data that was newer
and discarding the older one.
2016-08-12 17:15:43 +02:00
Krzesimir Nowak
7f46b90e27 Make LatestMap "generic"
This commit makes the LatestMap type a sort of a base class, that
should not be used directly. This also adds a generator for LatestMap
"concrete" types with a specific data type in the LatestEntry.
2016-08-12 17:03:42 +02:00
Matthias Radestock
1091225bf6 get rid of Node.Copy()
A shallow copy is sufficient. Which we get for free in most cases
since Node is passed around by value.
2016-08-02 12:42:39 +00:00
Matthias Radestock
c4fa72110c don't Copy() self on Merge()
Merge() is always returning a copy, so there is no need to Copy()
struct fields first before calling Merge() on them.

This reduces GC pressure (#1010) and helps overall app performance
(#1457).
2016-07-28 22:21:06 +01:00
Paul Bellamy
e7ebb83e23 Prune is only used in tests, so let's move it there 2016-04-22 14:14:30 +01:00
Paul Bellamy
1edeb8d190 Removing report.Node.WithID (#1315)
* removing usage of report.Node.WithID

* report.Topology.AddNode can use the node's ID field
2016-04-19 16:48:03 +01:00
Paul Bellamy
fe6203fd3f Review Feedback
Squash of:
- including children in topologies_test.go
- report.Node.Prune should prune children also
- rewrote ShortLivedInternetConnections test to express its intent
- adding tests for detail Summary rendering
2016-03-29 14:13:20 +01:00
Paul Bellamy
2c6b6e6707 Refactoring rendering to remove RenderableNode
Squash of:
- use detailed.Summaries to render topology nodes
- ban merging nodes of different topologies (they should be mapped)
- need to prune parents when mapping node types
- render container images by id if they have no name
- remove separate render ids and prune parents in NewDerived*
- don't render metrics/metadata for groups of nodes
- fixing up tests
- removing pending unit tests (for mapping.go, for now)
- updating experimental dir for RenderableNode removal
2016-03-29 14:13:03 +01:00
Tom Wilkie
bc3f946810 Make NodeMetadatas immutable. 2016-01-23 13:02:16 -08:00
Tom Wilkie
6b56475766 Use ps.Map for Counters and Sets, remove Metadata in favour of Latest.
Also
- Add more complicated report.json for benchmark
- Break up report/topology.go
- Implement our own DeepEqual for ps.Map
2016-01-22 15:10:32 -08:00