Matthias Radestock
e643ec56be
refactor: move filter logic to FilterFunc
...
so it becomes accessible w/o having to construct a Filter renderer.
2017-11-21 20:16:59 +00:00
Matthias Radestock
88e8b52d66
Decorators, begone!
...
Decorators were just a complicated way of constructing filters.
2017-11-21 20:16:30 +00:00
Matthias Radestock
093857f37f
refactor: extract a little test helper
2017-11-21 20:13:14 +00:00
Matthias Radestock
67950985ef
refactor: introduce IsConnected FilterFunc
...
and rename existing IsConnected const to IsConnectedMark
2017-11-20 09:28:56 +00:00
Matthias Radestock
ae153e57f5
refactor: remove Decorator from render.Renderer.Render() signature
2017-11-18 18:04:52 +00:00
Matthias Radestock
a82d245e93
simplify render decoration
...
Decoration is in fact quite a simple process that is applied on entry
to rendering: we take a base renderer, transform it with a decorator,
and then render a report with it. The new render.Decorate() function
does exactly that.
There is one exception. When rendering an individual node, e.g. for
showing its details panel in the UI, we must not lose the node during
decoration. That requires some special logic, which previously resided
in the PreciousNodeRenderer, and now lives in handleNode.
2017-11-18 18:04:52 +00:00
Matthias Radestock
aaf4e54df2
pass render filters and maps by value rather than reference
...
They are small and don't carry mutable state, so there is no point
passing them by reference.
2017-11-18 12:10:00 +00:00
Bryan Boreham
b9890064c2
Copy net.ParseIP and modify to save memory allocations
...
Pass in a slice on the stack instead of allocating one on the heap:
reduces garbage, hence makes the program run faster
Also apply knowledge that critbitgo will do an append() with one extra
byte, so we do that allocation up-front too. This is innocuous should
we stop using critbitgo or should its internals change.
2017-11-15 23:15:55 +00:00
Matthias Radestock
21a91fe9dd
remove HostRenderer memoisation
...
since it was only introduced to because producing stats would hit the
renderer twice, which is no longer the case.
2017-11-08 07:15:28 +00:00
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