21 Commits

Author SHA1 Message Date
Bryan Boreham
d60f3030ca Extend TestLatestMapMerge()
Add a test case where one input is longer than the other; also run
each case both ways round.

Omit the case which was already the reverse of another.
2018-07-09 19:19:23 +00:00
Bryan Boreham
f17640646e Blank out value on LatestMap decode insert
Fixing a rare case that came up in a test. In order for this to cause
a problem, the data being decoded has to have entries out of order,
and have a value that is nil or omitted.
2018-02-26 10:34:53 +00:00
Matthias Radestock
f305c35bfd do not report allocations in benchmarks
That's what -benchmem is for.
2017-12-07 20:27:31 +00:00
Bryan Boreham
d1bf98dfde Remove struct wrapping LatestMap
It isn't necessary, and it prevents the codec from seeing maps as empty
2017-12-06 15:46:31 +00:00
Bryan Boreham
a52c9df48c Added benchmarks for encode and decode of StringLatestMap 2017-10-01 16:19:00 +00:00
Bryan Boreham
736ae5e7c8 Refactor: extract fn to make map for benchmarks 2017-10-01 16:19:00 +00:00
Bryan Boreham
29f139d424 Re-implement LatestMap as a sorted slice for better performance
both the Python generator and the Go generated code are checked in
2017-10-01 16:18:59 +00:00
Matthias Radestock
430e74a80a refactor: remove report latest map Delete()
It wasn't used, and is problematic in any case since it introduces
non-monotonicity.
2017-07-03 02:06:21 +01:00
Matthias Radestock
9dc50b5202 refactor: hide "empty set" constants
They are an implementation detail.
2017-07-03 01:26:22 +01:00
Bryan Boreham
de97a72661 Remove indirection via LatestMap
Structs like StringLatestMap now use ps.Map directly, which saves
a memory allocation for LatestEntry.Value to point to.
The values in the ps.Map are now pointers, which saves a memory
allocation indirecting a value type to an interface{}
2017-03-20 11:51:04 +00:00
Jonathan Lange
1020fc5f85 Use test.Diff from common 2016-12-07 11:22:40 +00: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
Alfonso Acosta
b5c488faec Fix tests 2016-07-26 10:55:22 +00:00
Paul Bellamy
52c2498373 adding benchmark for LatestMap.Merge 2016-05-10 10:48:54 +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
Alfonso Acosta
0d917b2d8b Use github.com/ugorji/go/codec/ for wiring messages
* New encoding format:
  * Msgpack reports between probe<->app (smaller representation, faster to
    encode/decode).
  * Still use JSON between app<->UI (try to avoid making javascript deal with
    mspack).

  The app still suports publishing reports in both gob and JSON, not braking
  backwards compatibility.

* Use compile-time generated marshallers/unmarshallers for higher performance. In
  order to be able to skip code-generation for certain types, I included
  https://github.com/2opremio/go-1/tree/master/codec/codecgen instead of
  upstream until https://github.com/ugorji/go/pull/139 is merged.

* Encode/decode intermediate types using github.com/ugorji/go/codec.Selfer
  for higher performance and reducing garbage collection (no temporary buffers).
2016-02-16 06:31:31 +00:00
Tom Wilkie
7a70a076b8 Make counter zero value useable. 2016-01-25 12:52:19 -08:00
Paul Bellamy
b809f94272 make zero value of LatestMap valid 2016-01-25 17:33:24 +00:00
Tom Wilkie
d1c0fcec2d Review feedback. 2016-01-25 08:39:42 -08:00
Tom Wilkie
f2df789503 Add tests for latest map. 2016-01-24 13:55:48 -08:00