This reverts commit 6b72246fe6.
The app merges reports within a 15-second window of its own time, so
if one or more probes have a time that is several seconds different
they will get excluded from the window.
Previously the code called `time.Now()` in two different places so the
timestamps didn't match. Now we use the timestamp of the report itself.
Add the collector's local time to the report if it didn't have one.
Shortcut reports are sent to update the UI quickly, on events like a
container starting. We don't need to persist them in the time-travel
data since the same information will be covered by a regular report a
few seconds later.
Previously we would merge all reports in a 15-second window.
Now we use a 'quantum' of 3 seconds, similar to the single-user app.
E.g. a 30-node cluster will have 150 individual reports over 15
seconds, but the new code will merge 5 pre-merged reports plus 20-ish
very recent individual ones.
This limits the max heap size used for deserialising, since we only do
3 seconds at once per instance.
Individual reports are still put into the cache, but should get
displaced by the pre-merged ones under LRU.
In a multitenant system it is useful to be able to drill into which
tenants have the most or biggest reports.
Signed-off-by: Bryan Boreham <bryan@weave.works>
* Pass Go context down to Renderers
This is useful for cancellation or tracing.
* Add tracing spans to app
Also log things like number of nodes in Map, total number of reports.
This requires no report reading / merging.
We plan to expose this in the HTTP API, so the UI gets a cheap way of
checking whether the app is currently receiving data from probes.
golint has gained a new check and we don't freeze the golint version so CI was
failing on unrelated PRs:
app/multitenant/consul_client.go:69:2: redundant if ...; err != nil check, just return error instead.
report/marshal.go:188:2: redundant if ...; err != nil check, just return error instead.
Fix those!
* Hacky working prototype.
* Operate with time.Duration offset instead of fixed timestamp.
* Polished the backend code.
* Made a nicer UI component.
* Small refactorings of the websockets code.
* Fixed the backend tests.
* Better websocketing and smoother transitions
* Small styling refactoring.
* Detecting empty topologies.
* Improved error messaging.
* Addressed some of David's comments.
* Moved nodesDeltaBuffer to a global state to fix the paused status rendering bug.
* Small styling changes
* Changed the websocket global state variables a bit.
* Polishing & refactoring.
* More polishing.
* Final refactoring.
* Addressed a couple of bugs.
* Hidden the timeline control behind Cloud context and a feature flag.
* Addressed most of @davkal's comments.
* Added mixpanel tracking.