Commit Graph

187 Commits

Author SHA1 Message Date
Tom Wilkie
f154e7a483 Add connection tables to details panel 2016-03-03 16:17:55 +00:00
Tom Wilkie
bc48a48133 Split the internet node for incoming vs outgoing connections. 2016-03-01 14:11:47 +00:00
Tom Wilkie
897e0d4eb6 A 1ms window is ludicrously small; GC can take longer. 2016-02-29 18:57:00 +00:00
Paul Bellamy
35fe8864a1 Review Feedback 2016-02-25 16:34:35 +00:00
Paul Bellamy
cfc071471b Add ping/pong to websocket protocol 2016-02-24 17:16:35 +00:00
Paul Bellamy
f794bbff3d log errors on control and pipe websockets as well (now that we can) 2016-02-24 16:25:05 +00:00
Paul Bellamy
e865890d72 Don't log "expected" websocket errors, like the socket being closed 2016-02-24 16:25:05 +00:00
Tom Wilkie
5f7f74bf1b Refactor app for multitenancy
- Add interfaces to allow for alternative implementations for Collector, ControlRouter
  and PipeRouter.
- Pass contexts on http handlers to these interfaces.  Although not used by the current
  (local, in-memory) implementations, the idea is this will be used to pass headers to
  implementations which support multitenancy (by, for instance, putting an authenticating
  reverse proxy in form of the app, and then inspecting the headers of the request for
  a used id).
2016-02-22 14:54:04 +00:00
Paul Bellamy
0379fc4cf3 generate an ID for each memoiser so they can share cache
Makes cache clearing easier, and then we don't need to add
`ResetCache()` to the Renderer interface.
2016-02-17 17:10:14 +00:00
Paul Bellamy
a0a60ca079 Remove pointer math (comparison) from render caching, as it is unreliable 2016-02-17 15:41:16 +00: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
d4e58b9e33 Decouple Scope lifecycle from Weave lifecycle
- Run the Weave integrations regardless of if weave is detected.
- Make everything backoff and not spam the logs.
- Add miekg dns to vendor.
- Have the app periodically register with weaveDNS, and the probe do lookups there.
- Decide what the local networks are at runtime, not once at startup.
- Correctly resolve app ids, fixes #825
2016-02-09 14:24:57 +00:00
Alfonso Acosta
3d94082b07 Add debug logging 2016-02-05 16:58:40 +00:00
Tom Wilkie
d3b11ee040 Rename Applications -> Process, sort topologies by rank. 2016-02-01 06:54:18 -08:00
Paul Bellamy
75245f6777 Merge pull request #856 from weaveworks/826-by-hostname
Rename 'by hostname' to 'by dns name'
2016-02-01 10:56:02 +00:00
Tom Wilkie
8af839ce26 Cache reports generated by the collector. 2016-01-26 16:31:31 -08:00
Tom Wilkie
57f5a8bb04 Make the collector's report IDs a hash of the merged in report. 2016-01-26 16:03:34 -08:00
Tom Wilkie
0e3e3b74f8 Add benchmark for list topologies API. 2016-01-25 21:48:18 -08:00
Tom Wilkie
41d48224aa Fix tests 2016-01-25 13:46:28 -08:00
Tom Wilkie
586cfbfcea Rename 'by hostname' to 'by dns name' 2016-01-24 14:25:20 -08:00
Tom Wilkie
2520eac507 Merge pull request #833 from weaveworks/832-i-broke-pprof
Loop in the http.DefaultServeMux for pprof.
2016-01-19 09:35:45 -08:00
Paul Bellamy
56122dd0cc Details panel backend redesign
Megasquish:
  [app] remove unused edge endpoint
  [WIP] refactoring node details api endpoint
  [WIP] plumbing the children through the rendering process
  adding IDList.Remove and StringSet.Remove
  [WIP] working on adding parents to detailed node renderings
  WIP UI components with mock backend data for new details
  grouping children by type
  UI components for node details health and info
  metric formatters for details panel
  Column headers and links for details table
  [WIP] started on rendering node metadata and metrics in the detail view
  DetailedNode.LabelMajor -> DetailedNode.Label
  rendering decent labels for parents of detailed nodes
  render metrics onto the top-level detailed node
  removing dead code
  Links to relatives
  metrics have a Format not Unit
  Show more/less actions for tables and relatives
  adjusted metric formatter
  TopologyTagger should tag k8s topology nodes
  make renderablenode ids more consistent, e.g. container:abcd1234
  working on rendering correct summaries for each node
  adding report.Node.Rank, so that merging is independent of order
  rendering children and parents correctly
  output child renderableNode ids, so we can link to them
  add group field to metrics, so they can be grouped
  Refactored details health items to prepare for grouping
  add metrics to processNodeSummaries
  hide summary section if there is no data for it
  fixing up tests
  moving detailed node rendering into a separate package
  Node ID/Topology are fields not metadata
    - This way I think we don't have to care about Metadata being non-commutative.
    - ID and topology are still non-commutative, as I'm not sure how to sanely
  merge them, but it's possible we don't care.
  host memory usage is a filesize, not a percent
  working on fixing some tests
  adding children to hosts detail panel
    - Had to redo how parents are calculated, so that children wouldn't interfere with it
    - have to have the host at the end because it is non-commutative
  only render links for linkable children (i.e. not unconnected processes)
  resolving TODOs
  fixing up lint errors
  make nil a valid value for render.Children so tests are cleaner
  working on backend tests
  make client handle missing metrics property
  Stop rendering container image nodes with process summaries/parents
  fix parent link to container images
  Calculate parents as a set on report.Node (except k8s)
  refactoring detailed.NodeSummary stuff
  removing RenderableNode.Summary*, we already track it on report.Node
  working on tests
  add Columns field to NodeSummaryGroup
  fixing up render/topologies_test
  fix children links to container images
  get children of hosts rendering right
  working on host renderer tests
  Change container report.Node.ID to a1b2c3;<container>
  The id should be globally unique, so we don't need the host id.
    This lets the kubernetes probe return a container node with the pod id,
    which will get merged into the real containers with other reports. The
    catch is that the kubernetes api doesn't tell us which hostname the
    container is running on, so we can't populate the old-style node ids.
  change terminology of system pods and services
  Fix kubernetes services with no selector
  Fixes handling of kubernetes service, which has no pods
  fix parent links for pods/services
  refactor detailed metadata to include sets and latest data
  fixing up host rendering tests
  fleshing out tests for node metadata and metrics
  don't render container pseudo-nodes as processes
  Update test for id format change.
2016-01-19 16:39:37 +01:00
Paul Bellamy
a972e883e0 Reword filter text on kubernetes views 2016-01-18 10:26:11 +00:00
Tom Wilkie
b102a977b8 Loop in the http.DefaultServeMux for pprof. 2016-01-16 13:38:00 -08:00
Tom Wilkie
123c40028f Less hacky fix for /%2F bug 2016-01-14 07:10:31 -08:00
Tom Wilkie
ffa955a21b Split and move xfer package. 2016-01-06 14:01:39 +00:00
Tom Wilkie
6259307491 Don't use a global variable to store the pipe client. 2015-12-10 15:44:25 +00:00
Tom Wilkie
3a344f12ea Backend review feedback 2015-12-10 12:53:31 +00:00
Tom Wilkie
ac9c011475 Pipe plumbing
- Add store of pipes in the app
- Add pipe type, handling impedance mismatch, used in app and probe.
- App <-> Probe pipes have their own websockets.
- Add pipe websocket endpoint in app.
- Pipe IDs are strings, lose the request/response IDs, and give the json encoder lowercase field names.
- Add simple golang ws client, for testing.
- Pipe lifecycle plumbing.
- Ref count and timeout both ends of pipes in the app
- Deal with POST /api/pipe/:pid?_method=delete
- Add end-to-end unit test for pipes.
- Add test for timing out pipes.
- Update go-docker client to tomwilkie/go-dockerclient
- Backend work for non-raw ttys
- Close pipes when they close themselves in the probe
- Ensure all http connections are done before returning from client.Stop()
2015-12-10 12:51:17 +00:00
Tom Wilkie
ec9a3b135c Add a little test for collector.go 2015-12-08 17:59:24 +00:00
Paul Bellamy
a13042aafe [app] remove unused edge endpoint 2015-12-07 15:33:59 +00:00
Tom Wilkie
c317cff86e App: Rename package main->app, put main.go in prog/app 2015-12-07 14:53:28 +00:00
Paul Bellamy
269a11759f makefile should build app/static.go when needed
- Add non-containerised build for UI.
- Update README for new build steps.
2015-12-07 14:53:28 +00:00
Tom Wilkie
f1d225c836 Add hostname to /api 2015-12-04 15:33:12 +01:00
Tom Wilkie
99d72cbc2b Use common.SignalHandlerLoop from weave, and document debug options. 2015-12-04 10:01:00 +00:00
Paul Bellamy
68cff926be Add json support to app POST /api/report
This way you can save reports from /app/report, then use curl to post it
to the app later for testing.
2015-12-03 11:39:37 +00:00
Tom Wilkie
3262fa7a5e make static 2015-11-30 14:06:17 +00:00
Tom Wilkie
f5aafb7a05 Don't apply filters to node endpoints & update details panel logic such that node which dissappear from the topology (eg when they are stopped) don't dissapear from the details panel. 2015-11-30 09:33:41 +00:00
Paul Bellamy
7de420cdb1 make static 2015-11-20 11:32:56 +00:00
Tom Wilkie
310b2c8d07 make static 2015-11-16 10:44:30 +00:00
Tom Wilkie
95bca02e4d make static 2015-11-11 17:24:35 +00:00
Tom Wilkie
47ef1e02b3 Shortcut app -> UI ws push for certain reports. 2015-11-10 13:46:57 +00:00
Tom Wilkie
f7c75f9cd3 Make static 2015-11-06 18:25:41 +00:00
Tom Wilkie
39b66300a6 Merge pull request #598 from weaveworks/315-capabilities
Add controls form container start, stop, pause, etc
2015-11-06 18:22:05 +00:00
Tom Wilkie
8f957c4f13 Add docker lifecycle controls, containers in states other that running, and a filter for those containers.
Also add integration test for container controls.
2015-11-06 17:39:54 +00:00
Tom Wilkie
76d34330a9 Add Control plumbing. 2015-11-06 17:39:48 +00:00
Paul Bellamy
9877a2126a removing unused /api/origin/host/{id} route 2015-11-06 16:20:00 +00:00
Tom Wilkie
d5922e437f Fix stats for sub topologies. 2015-11-05 15:06:29 +00:00
Paul Bellamy
9ea156cfef Moving xfer.Collector into App (the only place its used) 2015-11-05 11:31:48 +00:00
Tom Wilkie
ad09d1effc make static 2015-11-03 18:17:47 +00:00