Commit Graph

212 Commits

Author SHA1 Message Date
Matthias Radestock
21c188d600 Merge pull request #1739 from weaveworks/1730-no-node-copy
Remove and optimize more Copy()s
2016-08-12 12:30:54 +01:00
Alfonso Acosta
94eb7454ff Do not attribute connections to containers based on loopback addresses 2016-08-10 10:56:37 +00:00
Alfonso Acosta
3892273096 Append namespace to endpoint scope for loopback connections 2016-08-10 10:43:04 +00:00
Alfonso Acosta
b8c99ed7cc Revert "Cache generated ids to relieve pressure on the GC"
It wasn't working as noticed by @rade (note the err != nil) and was complicating
the code.

This reverts commit 2f760f2f33.
2016-08-09 14:59:28 +00:00
Alfonso Acosta
5d857d05d6 Remove and optimize more Copy()s 2016-08-02 13:29:35 +00: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
Alfonso Acosta
4ed6afdb3a Review feedback 2016-08-01 20:06:05 +00:00
Alfonso Acosta
eaa3baec9d Preallocate metrics when copying 2016-08-01 19:35:43 +00:00
Alfonso Acosta
af08ba3245 Optimize Merge() for Metric 2016-08-01 19:34:32 +00:00
Alfonso Acosta
31f938cdad Remove Metric WithFirst() method
It was only used in tests and wasn't really necessary
2016-08-01 16:58:21 +00:00
Alfonso Acosta
8a950a59d6 Remove Metric Add() method
* Helps reduce garbage (MakeMetric() now takes a slice and there's a shorter version MakeSingletonMetric())
* Fixes bug computing Max (Min) in samples since using MakeMetric()
  was causing a default Max/Min of zero.
* Simplifies code a bit
2016-08-01 16:58:11 +00:00
Alfonso Acosta
3e000662f4 Restore custom encoders/decoders for backwards compatibility 2016-08-01 11:07:03 +00:00
Alfonso Acosta
b8bf60c6f1 Use slices instead of linked lists for Metric
Also:

* Remove Gob encoder/decoder
* Stop using custom encoders/decoders for Timestamps (both ugorji and the Golang JSON codecs use nanosecond precision).
* Use idiomatic way to check for existence in metric.LastSample()
2016-08-01 10:21:57 +00:00
Matthias Radestock
15cf1e16b2 micro optimisation: avoid some unnecessary copying 2016-07-29 18:56:06 +01:00
Matthias Radestock
17fe25d8c3 shallow-copy instead of (deep) Copy() in Merge()
Merge() must not modify self or other; shallow-copying is sufficient
to achieve that.
2016-07-29 10:00:01 +01: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
Alfonso Acosta
b5c488faec Fix tests 2016-07-26 10:55:22 +00:00
Alfonso Acosta
a80429ded2 LatestMap codec performance improvements and cleanups
* Allocate all map entries of the intermadiate representation at once
* Use UnsafeMutableMap to improve performance of LatestMap construction
* Remove gob encoder/decoder
2016-07-26 10:35:56 +00:00
Alfonso Acosta
ecc8a3138f Replace github.com/mndrix/ps by github.com/weaveworks/ps 2016-07-26 10:35:55 +00:00
Tom Wilkie
78199aa25f Custom encoder for latest maps (#1709)
* Customer encoder for latest maps

- Cuts out intermediate type
- Should be backwards compatible with existing reports.

* Make it build cleanly

* Review feedback
2016-07-21 16:19:57 +01:00
Jonathan Lange
2bfd6d7eb7 Parametrize compression level 2016-07-15 11:24:36 +01:00
Jonathan Lange
e4c75e6223 Test for marshalling 2016-07-14 18:06:10 +01:00
Bryan Boreham
7d579122aa Use a slice instead of a persistent list for temporary accumulation of lists
Avoids creating O(n) garbage by using a slice with enough capacity to
hold the temporary head-portion of the list accumulated while walking
the list to insert element(s).
2016-07-11 11:18:07 +01:00
Alfonso Acosta
6175880725 Review feedback 2016-07-05 10:47:57 +00:00
Jonathan Lange
23faf583b3 Drop gob support 2016-06-21 11:56:56 +01:00
Jonathan Lange
8bd8f883a1 Restore debugging logic 2016-06-21 11:08:55 +01:00
Jonathan Lange
e5417342ba Review comments 2016-06-21 10:33:15 +01:00
Jonathan Lange
81b05a33ee Make ReadBinary more general and re-use in router 2016-06-20 18:02:23 +01:00
Jonathan Lange
13269e8110 Helper for reading & writing from binary 2016-06-17 15:24:33 +01:00
Tom Wilkie
fba555c985 Use image name without version as id. (#1531)
* Use image name without version as id.

* Review feedback
2016-06-15 16:14:51 +01:00
David Kaltschmidt
645f2ca9f4 Add hint that a section may be truncated 2016-05-11 13:05:19 +02:00
Alfonso Acosta
100f78d771 Provide truncation counts to the UI 2016-05-11 01:22:33 +00:00
Alfonso Acosta
7a8e61454f Limit tables to 20 rows 2016-05-10 14:46:24 +00:00
Paul Bellamy
291c9afe58 Add scale up/down controls on deployments, replica sets, and replication controllers (#1451) 2016-05-10 12:43:52 +02:00
Paul Bellamy
52c2498373 adding benchmark for LatestMap.Merge 2016-05-10 10:48:54 +01:00
Paul Bellamy
16a5c738d9 Deployment and ReplicaSet views for k8s 2016-05-09 09:03:57 +01:00
Paul Bellamy
0178babb0e Index services by UID, and refactor out common k8s metadata handling 2016-05-09 09:03:56 +01:00
Tom Wilkie
1c5f0ac041 Don't attribute conntracked connections to k8s pause containers. 2016-05-03 12:04:08 +01:00
Tom Wilkie
8395c3ca4b Index Pods by UID and join with containers based on this. 2016-05-03 11:51:51 +01:00
Tom Wilkie
02554b1dcd Propagate network info for containers sharing network namespaces (#1401)
- Add armon/go-radix library, use this to find containers by prefix
- Deal with host net namespace in the same way
2016-04-29 18:13:55 +01:00
Paul Bellamy
64450a4830 Merge pull request #1371 from weaveworks/1219-grouped-node-counts-2
Fixing grouped node count for filtered children nodes
2016-04-28 13:30:15 +01:00
Paul Bellamy
3d3aed2bb3 Fixing grouped node count for filtered children nodes
Squash of:

* We have to keep all the container hostnames until the end so we can
  count how many we've filtered

* Adding tests for ContainerHostnameRenderer and PodServiceRenderer with
  filters

* Because we filter on image name we need the image name before
  filtering

* Alternative approach to passing decorators.

* Refactor out some of the decorator capture

* Don't memoise decorated calls to Render

* Fixing filtered counts on containers topology

  Tricky, because we need the filters to be silent sometimes (when they're
  in the middle), but not when they're at the top, so we take the "top"
  filter's stats. However, this means we have to compose all
  user-specified filters into a single Filter layer, so we can get all
  stats.

  There are no more Silent filters, as all filters are silent (unless they
  are at the top).

  Additionally, I clarified some of the filters as their usage/terminology
  was inconsistent and confused. Now Filter(IsFoo, ...) *keeps* only nodes
  where IsFoo is true.
2016-04-28 12:23:43 +01:00
Tom Wilkie
b05ef74552 Report hostname and version in probe struct, and version in host node. 2016-04-26 09:25:15 +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
Tom Wilkie
8b06f6c0d8 Add rank field to controls. 2016-04-21 18:05:48 +01:00
Tom Wilkie
99204e1ff7 Add k8s pod log control (#1298)
* Remove individually vendored k8s.io/kubernetes/pkg/<foo>

* Vendor the whole of vendor/k8s.io/kubernetes/pkg

* Add k8s pod log control

* Tag pods with host id and include them in the host topology as children.

* adding a basic test for kubernetes.Reporter.GetLogs
2016-04-21 13:48:50 +01:00
Paul Bellamy
4bd3832219 move counting sublabel definition to the topologies 2016-04-20 12:17:46 +01:00
Paul Bellamy
4ad1ae80df move shapes determination to the topology 2016-04-20 12:17:46 +01:00
Tom Wilkie
9eda27822c Show k8s labels and container env vars in the details panel. (#1342)
* Show k8s labels and container env vars in the details panel.

* Add show more bar to the env vars and labels

* React key was in the wrong place; empty tables render section labels.
2016-04-20 08:18:03 +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