Commit Graph

362 Commits

Author SHA1 Message Date
Bryan Boreham
0d2409c72c Add method to add a single string into Sets
This avoids creating and discarding a StringSet just to pass the parameter
2018-07-17 13:51:46 +00:00
Bryan Boreham
dad34df575 Merge pull request #3267 from weaveworks/pool-gzwriters
Re-use gzip writers in a pool
2018-07-13 16:09:24 +01:00
Bryan Boreham
692214bf40 Test Sets.Add() 2018-07-12 19:54:02 +00:00
Bryan Boreham
d37611a4a3 Make TestSetsMerge() check both ways round 2018-07-12 19:54:01 +00:00
Bryan Boreham
8e305f1ce9 Don't copy StringSet if merging a subset
Make StringSet.Merge() work like StringLatestMap.Merge()
2018-07-12 19:54:01 +00:00
Bryan Boreham
dac008b9c4 Early return from LatestMap merge loop
If we run out of things to look at in the other map, return quickly.
Also move the equal-key case above the less-than case, since maps with
equal keys are the common case when merging.
2018-07-12 19:54:01 +00:00
Bryan Boreham
c91fd6c67b Optimise merge of LatestMaps with same keys, different timestamps
Swap the two maps so we are merging older into later.
2018-07-12 19:54:01 +00:00
Bryan Boreham
43a0a7e5d3 Don't copy LatestMap if merging a subset 2018-07-12 19:50:02 +00:00
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
c96611b13d Less verbose string dump of LatestMap
The default time.Time.String() includes nanoseconds, wall-clock adjustment, etc.
Also don't include the key twice when stringizing the map itself.
2018-07-08 16:32:51 +00:00
Bryan Boreham
70cd79307e Re-use gzip writers in a pool
Since they allocate sizeable chunks of memory, this can save on garbage-collection.
2018-07-08 16:30:07 +00:00
Bryan Boreham
8e5b19cbcb Use buffer pool in report.MakeFromBytes() to reduce garbage-collection 2018-07-04 14:03:17 +00:00
Bryan Boreham
84169c6c55 Use a buffer pool in report.ReadBinary() to reduce garbage-collection 2018-07-04 13:35:44 +00:00
Bryan Boreham
3c07c93847 Merge pull request #3236 from weaveworks/fast-merger
Faster report merging through mutating objects
2018-06-22 16:37:07 +01:00
Bryan Boreham
1706746a32 Faster report merging through mutating objects
When we know we have the only reference to a Report or Node object we
can avoid copying the data to change it. Add "Unsafe" variants of
various Merge operations which mutate the receiver, and a new Merger
which takes advantage of them.
2018-06-22 11:59:43 +00:00
Bryan Boreham
80dbd3443c probe: Add -probe.publish.stdout option for debugging
This option gives a crude way to view the raw probe data as json in
the container logs, so that you can check exactly what it would have
sent.

We stub out the PipeClient interface with a dummy implementation in
this mode.
2018-06-19 22:59:01 +00:00
Bryan Boreham
06c895267c Reports: streamline report serialization
Move the creation of the buffer and the choice of compression level
(which never changes) into WriteBinary(), to simplify the code.
2018-06-19 22:59:01 +00:00
Bryan Boreham
8c18a785e7 Merge pull request #3132 from openebs/add-pv-pvc-support
Add Kubernetes Storage (pv and pvc) support in Weave Scope
2018-06-08 12:41:21 +01:00
Satyam Zode
d26b2c3805 Add Kubernetes storage class resource to weave scope
This will:

- Add StorageClass resource. Storage classes are mentioned
in the PVC spec. We're using storage class name from PVC spec to
add adjacency to the PVC node.
- Add square sheet shape for StorageClass.
- Add storage filter in the PODS topology.
Storage Filter will allow user to see distinct view of
stateful applications.
- Add visually distinct edge to show storage adjacency.

Signed-off-by: Satyam Zode <satyam.zode@openebs.io>
2018-06-08 16:36:29 +05:30
Satyam Zode
23210a6a77 Add Kubernetes volumes support in Weave Scope
This will

- Add Kubernetes volume resources such as PV, PVC.
- Add shapes for Kubernetes PV and PVC
- Add `Cylinder` shape for PV and `Dotted Cylinder` shape for PVC.

Signed-off-by: Satyam Zode <satyam.zode@openebs.io>
2018-06-07 17:01:29 +05:30
Bryan Boreham
009af5be0c Probe: remove backwards-compatibility code when publishing reports
Removed to reduce CPU and memory usage in probes.

This code was added in August 2016 so that newer probes could be used
with older apps. Since then we have adopted the stance that new apps
will accept reports from old probes but not vice-versa, on a version
change.
2018-06-05 16:47:23 +00:00
Filip Barl
4382deb39b Show image tag separate from image name in Node Details. 2018-05-17 11:09:31 +02:00
Marcus Cobden
0dfbe8b10f Fix tests broken by hasty merging 2018-05-03 19:27:50 +01:00
Marcus Cobden
8eb9fc86ae Add null checks to fix querier panic 2018-05-03 17:23:58 +01:00
Bryan Boreham
1455597a48 Merge pull request #3142 from weaveworks/faster-critbit
Faster path to check an IP address against known networks
2018-04-16 20:51:22 +01:00
Matthias Radestock
82cd367379 Merge pull request #3139 from weaveworks/3127-no-truncate
do not truncate tables

Fixes #3127.
2018-04-15 21:49:19 +01:00
Bryan Boreham
3711876194 Use unsafe merge in joinResults.addChildAndChildren(), for performance 2018-04-15 09:39:21 +00:00
Bryan Boreham
04ceb0cc87 Faster path to check an IP address against known networks
We modify the critbitgo library to skip creating a route object we don't use.

The weaveworks-local modification can be removed if
https://github.com/k-sone/critbitgo/pull/7 is merged.
2018-04-14 20:44:09 +00:00
Bryan Boreham
7a03bc03f8 Use faster code to accumulate children when rendering
Make sure all the Children NodeSets are not shared with any other
nodes, then we can use the non-persistent add path.
2018-04-13 07:44:21 +00:00
Matthias Radestock
36ea7907e4 export less & comment more
to make the linter happy
2018-04-12 17:24:29 +01:00
Matthias Radestock
24672ed046 do not truncate tables
Limiting env vars, docker&k8s labels, and weave net connection entries
to 20 is problematic because

- the truncation is arbitrary - there is a good chance that if you
care about a specific entry it won't be there

- the truncation is not consistent - different entries get truncated
at different times

- some of the rendering logic depends on specific labels, for example
namespace filtering of containers depends on the
`io.kubernetes.pod.namespace` label.

In practice, there should never be a huge number of labels, or Weave
Net connection entries. So there is no need to truncate them.

That leaves env vars. These are of limited use, so we now omit them by
default. If they are included they are included in full, so they are
actually useful.

Fixes #3127
2018-04-12 17:13:58 +01:00
Bryan Boreham
27cf8f3b06 Fix format string to work for all types 2018-04-05 08:18:52 +00:00
Matthias Radestock
fd3ac19c02 refactor: remove dead code 2018-04-02 13:27:51 +01:00
Matthias Radestock
27fb3571e1 refactor: remove StateDeleted from map keys
since it is a map value, not a key.
2018-04-02 11:03:01 +01:00
Matthias Radestock
eaafe4db6f copy Shortcut property in Report.Copy()
This was causing shortcut reports to be delivered as normal reports.

This got broken in 0ecb908c22, when Report.BackwardCompatible(),
which does a Copy(), was introduced in the publishing path.

Fixes #3113.
2018-03-25 09:02:36 +01:00
Matthias Radestock
c9d9068f68 Merge pull request #2399 from weaveworks/big-roundtrip
Add a test that checks if reports with data round-trip
2018-02-26 13:44:22 +00:00
Matthias Radestock
306a744189 Merge pull request #3095 from weaveworks/blank-latestmap-insert
Blank out value on LatestMap decode insert
2018-02-26 13:43:40 +00:00
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
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
Bryan Boreham
64570f1311 Add Kubernetes service type and ports 2018-02-24 14:58:13 +00:00
Bryan Boreham
b5cdcb9a42 Move DNS name mapping from endpoint to report 2018-02-20 16:14:21 +00:00
Bryan Boreham
b742846835 Optimise processTopology() (#3074)
* Add a benchmark for processprocessTopology()

* Shortcut merging with an empty set

* Use more efficient apis to create process node
2018-02-19 10:13:58 +00:00
Bryan Boreham
f72ced3380 Add topology.ReplaceNode() for efficiency (#3073)
* Add topology.ReplaceNode() for efficiency

In some places AddNode() was called after adding to an existing node,
in which case the Merge() is just a waste of time.
2018-02-19 10:13:31 +00:00
Matthias Radestock
5b30b668ae refactor: don't return receiver in Topology.AddNode()
This had little use and was obscuring the mutating nature of
AddNode().
2018-02-19 05:10:04 +00:00
Bryan Boreham
cb6edfeec1 Set 'omitempty' on Node Adjacency
Looks like an omission
2018-02-07 13:39:54 +00:00
Roberto Bruggemann
4233b75528 report.Upgrade: reconstruct namespaces
Old probes do not report namespace topologies.
`report.upgradeNamespaces()` recontructs namespace topologies using the data available from other kubernetes resources.

Also, add a test.
2018-01-03 13:55:27 +00:00
Roberto Bruggemann
ccfcc61042 The probe reports namespaces 2018-01-03 13:55:27 +00:00
Roberto Bruggemann
f9f0487fdc Fix erroneous comments 2018-01-02 18:02:08 +00:00
Matthias Radestock
286453b9a9 refactor: move RenderContext where it belongs
It shouldn't be in 'report' because that is shared between the probe
and the app, and RenderContext, as the name suggests, is only needed
in the app.
2017-12-27 16:22:52 +00:00
Matthias Radestock
0cb34b53cc introduce ParseProcessNodeID
unused for now
2017-12-26 02:27:53 +00:00