Commit Graph

516 Commits

Author SHA1 Message Date
Matthias Radestock
9bd8bd825b remove now superfluous Renderer.Stats method
step 2 (and final step) in producing stats as part of Rendering
2017-11-08 07:15:28 +00:00
Matthias Radestock
8f7e00f46a Stats are easily produced as part of Rendering
...so there is no need for a separate Stats method.

step 1: return stats from Render
2017-11-08 07:15:28 +00:00
Bryan Boreham
917ef980a4 Memoise HostRenderer
This shows a big improvement in BenchmarkTopologyList
2017-11-07 10:18:27 +00:00
Bryan Boreham
ec0689b5aa Code review: improve consistency of naming and ordering 2017-11-06 22:12:13 +00:00
Bryan Boreham
4feb451760 Refactor join-Renderer helper functions as methods
New type joinResult is created to hold the nodes and ID mapping.
The implementation move from host.go to render.go.
2017-11-06 22:12:13 +00:00
Bryan Boreham
cbba3c0fd3 Clarify use of 'id' in addToResults
Pass 'id' through to the create function and expect that the result Node has that ID.
Extract a function newPseudoNode for common calls.
2017-11-06 22:12:13 +00:00
Bryan Boreham
322aa76e02 Remove functions which are no longer called 2017-11-06 22:12:10 +00:00
Bryan Boreham
cbcb5f19fc Rewrite ProcessRenderer/MapEndpoint2Process as a single Renderer
This is much more efficient as we skip creating then merging all intermediate Nodes
2017-11-06 22:06:29 +00:00
Bryan Boreham
77a8cac65a Use helper to add result nodes in endpoints2Hosts.Render
This means we are no longer generating a Counter for the number of
endpoint sub-nodes, but it seems that data was not used.
2017-11-06 22:05:05 +00:00
Bryan Boreham
e16aaf6c43 Merge nodeToIP, endpoints2Nodes and ipToNode into one Renderer
This is much more efficient as we skip creating then merging all intermediate Nodes
2017-11-06 22:05:05 +00:00
Bryan Boreham
b684e3c6fc Rewrite MapEndpoint2Host as a Renderer
This allows us to avoid creating a host of 'IP' type Nodes then
discarding them after matching; instead we match directly and create
just the result we want.
2017-11-06 22:05:05 +00:00
Bryan Boreham
1b3e40ccb5 Refactor: extract pseudoNodeID function 2017-11-06 22:04:59 +00:00
Bryan Boreham
d230846b95 Refactor: extract externalNodeID function 2017-11-06 20:55:57 +00:00
Filip Barl
119bbab4fe Merge pull request #2915 from weaveworks/2875-humanize-durations
Humanize reported durations
2017-11-06 14:11:45 +01:00
Matthias Radestock
b3669bee84 Merge pull request #2924 from weaveworks/2923-memoise-less
remove unused memoisation

Fixes #2923
2017-11-06 10:35:22 +00:00
Matthias Radestock
7b0a08ae9d memoise renderer passed to ConnectionJoin
We do this here rather than in ConnectionJoin since that way it is
obvious that the renderer isn't memoised already.
2017-11-05 11:05:28 +00:00
Matthias Radestock
5f4f9da4df memoise a few more shared renderers 2017-11-05 00:21:45 +00:00
Matthias Radestock
b793a9efa8 memoise shared top-level renderers
and add a comment indicating non-memoisation of other, not shared
top-level renderers.

This memoisation is effective when the browser requests multiple
topologies for the same report.
2017-11-04 23:05:52 +00:00
Matthias Radestock
2bdab7513e ditch all memoisation
we will re-introduce it more selectively later
2017-11-04 22:21:50 +00:00
Bryan Boreham
800979a089 Avoid object creation when scanning DNS names
Since we do this a lot, scanning the lists in-place saves time.
Also we don't need to sort them since StringSet is implemented as a
sorted set of strings
2017-11-04 17:37:04 +00:00
Filip Barl
320b9e240f Abstracted the report data types. 2017-11-03 10:43:41 +01:00
Matthias Radestock
86292acf47 micro refactor: save a line, narrow scope 2017-08-18 19:28:36 +01:00
Matthias Radestock
7520713dc4 refactor: reduce duplication in links_test 2017-08-16 17:28:14 +01:00
Roland Schilter
f26c875c4c Filter by namespace in metric queries (#2819)
And get rid of B -> MB conversion

Fixes #2817
2017-08-16 17:08:51 +01:00
Roland Schilter
b69ce340f8 scope/cortex: fix typo in query filter (#2815)
* scope/cortex: fix typo in query

* Get rid of the "controllers" code

They do not all share the same queries.
2017-08-16 10:46:49 +01:00
Roland Schilter
0d381a34d6 Link scope-ui graphs clickable to prometheus queries (#2664)
scope-app:
* Adds `-app.metrics-graph` cli flag for configuring the base url to
use for graph links; supports :orgID and :query placeholders
* Assigns query URLs to existing metrics and appends empty metrics if missing

scope-ui:
* Extends <CloudFeature /> with option alwaysShow
* Adds <CloudLink /> to simplify routing when in cloud vs not in cloud
* Links metric graphs in the ui's node details view for all k8s
toplogies and containers so far
* Tracks metric graph click in mixpanel `scope.node.metric.click`
* Uses percentages and MB for CPU/Memory urls
* Passes timetravel timestamp to cortex in deeplink
2017-08-15 18:56:23 +01:00
Matthias Radestock
65cebed6c4 get rid of endpoint type indicators
The app stopped paying attention to these some time ago.

Removing them shrinks reports by 3-10%.
2017-07-30 08:38:56 +01:00
Mike Lang
486bdcc796 k8s: Use 'DaemonSet', 'StatefulSet' etc instead of 'Daemon Set', 'Stateful Set'
We can't search for terms with spaces.
2017-07-26 13:49:54 -07:00
Mike Lang
4d2b4541c9 Merge pull request #2724 from weaveworks/mike/k8s/jobs-and-petsets
kubernetes: Add StatefulSets and CronJobs
2017-07-19 16:27:53 -07:00
Mike Lang
ac96738ad0 render: In minor labels, display '0 things' instead of blank if zero things present
This also fixes a bug where k8s controller nodes would show up as 'Deployment of' without any number
2017-07-18 11:44:51 -07:00
Mike Lang
17fffb32e1 Add stateful sets and cronjobs to Controllers renderer
Since renderKubernetesTopologies was getting unweildy, refactored into a form
which was a bit clearer, if a bit more verbose.
2017-07-18 11:35:50 -07:00
Mike Lang
9fb6c46467 Add report topologies for Stateful Sets, Cron Jobs 2017-07-18 11:35:50 -07:00
Roland Schilter
a6d3542c89 Merge pull request #2713 from weaveworks/2708-reset-nodes-when-scope-app-restarted
Reset nodes in frontend when scope-app restarted
2017-07-14 19:02:41 +02:00
Matthias Radestock
ac9f7dfad1 simplify node propagation in ipToNode 2017-07-13 17:10:43 +01:00
Matthias Radestock
bd9fafff42 don't create *derived* nodes in nodeToIP
IP nodes are children of the "proper" topology nodes, not the other
way round. The former relationship is established in ipToNode.
2017-07-13 17:00:14 +01:00
Matthias Radestock
4a77e9bfac don't bother tracking the orignal node topology
We always join with the original renderer and hence all the nodes
produced by ipToNode will get their other data, including topology,
via that route.
2017-07-13 16:35:52 +01:00
Matthias Radestock
c7f94d8a74 join with original renderer in ConnectionJoin
This guarantees that the output won't contain bare nodes containing
just an id and topology, as produced by ipToNode. Previously this was
ensured by calling convention, now it's ensured by construction.
2017-07-13 16:28:02 +01:00
Matthias Radestock
387a68a3c7 tiny refactor: swap ConnectionJoin arg order
to match the style of other render HoFs, which take their inputs last.
2017-07-13 14:23:46 +01:00
Roland Schilter
5329efa528 Reset nodes in frontend when scope-app restarted
When the scope-app restarts, it no longer has a
reference to the previous node set. Therefore,
the delta update adds *all* nodes but does not
remove legacy ones.

`reset==true` tells the frontend to start fresh.

Fixes #2708
2017-07-13 14:28:17 +02:00
Mike Lang
1a2ad9c013 Merge pull request #2685 from weaveworks/mike/render/fix-map2parent-pseudo-id
render/pod: Fix a typo in Map2Parent where UnmanagedID will always be used for noParentsPseudoID
2017-07-05 14:02:38 -07:00
Matthias Radestock
d22d9d0768 Merge pull request #2682 from weaveworks/2681-image-counts
don't show container count in host detail panel image list

Fixes #2681.
2017-07-05 20:39:33 +01:00
Matthias Radestock
fd4f1f9d42 Merge pull request #2680 from weaveworks/2629-host-image-list
correct determination of a host's container images
2017-07-05 20:38:32 +01:00
Mike Lang
399cca026c render/pod: Fix a typo in Map2Parent where UnmanagedID will always be used for noParentsPseudoID
Thankfully we only ever set it to UnmanagedID right now, so no user-facing bug.
2017-07-05 11:33:06 -07:00
Matthias Radestock
c7a3f7c2fd Merge pull request #2675 from weaveworks/less-copy
refactor: remove unnecessary and dead Copy()
2017-07-05 14:33:31 +01:00
Matthias Radestock
0f4d17d868 don't show container count in host detail panel image list
The figure is inaccurate since it counts containers across all
hosts. Getting the count correct is non-trivial, so it's better to not
show the figure at all.

NB: the count still shows up on mouse-over of the link, but that is
defensible and not (very) confusing since the link represents the
image, not the image on a particular host, and it's the same count
that show up as the minor label in the container images view.

Fixes #2681.
2017-07-05 14:03:44 +01:00
Matthias Radestock
a0fb2e1d73 cosmetic(ish) 2017-07-05 12:49:23 +01:00
Matthias Radestock
0c122acf06 correct determination of a host's container images
The same container image may be in use on multiple hosts. The
latest-map HostNodeID of a node in the ContainerImage topology is
therefore meaningless - it gets set to whatever host reported that
image last in the time window covered by the report. Hence using it as
a basis for mapping to hosts, as we did, a) fails to associate images
with all the right hosts (hence they are missing from the host details
panel), and b) causes that association to change semi-randomly (hence
the list in the details panel is unstable).

By contrast, the host topology parents of container image nodes is the
complete set of all hosts the image is used on. So making that the
basis for mapping fixes the problem.

The same technique - mapping based on host parents rather than
latest-map HostNodeID - also works for the other nodes we are mapping:
processes, containers and pods. So we might as well use it there
too. That's also what Map2Parent does in other topology renderers.

Fixes #2629.
2017-07-05 09:09:32 +01:00
Matthias Radestock
57bc34f411 Merge pull request #2673 from weaveworks/mike/render/simplify-pods
render/pod: Remove unused options and incorrect code
2017-07-04 20:38:45 +01:00
Matthias Radestock
d4d3e5f184 correct comment 2017-07-04 20:37:55 +01:00
Matthias Radestock
a6491a35c3 refactor: remove unnecessary Copy() code 2017-07-04 07:35:30 +01:00