* 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.
There is nothing special about the "default" namespace, and selecting
it by default means we only show a partial view of the system, which
is hard to spot, especially for novice users.
This should never have been added. The IsNamespace filter will always return false for these nodes.
It isn't even clear what this filter would mean, even if implemented, since those nodes don't map to a single
container and therefore not to a single namespace.
We have to introduce the kinda hacky concept of a 'No Stack' stack
to reconcile it with the idea of a 'default' k8s namespace. This is important
because swarm services without a stack don't have the same docker labels as ones that do.
Curiously, they still have what appears to be a stack name 'prefix' on their names,
but I can't isolate that name anywhere easily so they'll just have to make do.
I basically copy-pasted updateFilters to make this work, todo go back and refactor
to not duplicate 90% of the code.
We want the middle ground between a small compression size, a fast
compression time and a fast decompression time.
Tests suggest that the default compression level is better than the
maximum compression level: although the reports are 4% bigger and
decompress slower, they compress 33% faster.
See discussion on https://github.com/weaveworks/scope/issues/1457#issuecomment-293288682
Instead of value being "" or omitted meaning "use group.Default", we now allow the empty value
to go through. This was done to allow multi-value options to be able to encode 'no options selected'.
This is important as the alternative is very confusing, as 'nothing selected' would generally mean
'match everything', not 'select default' (which in the k8s namespace example, means the "default" namespace).
Since the UI is the only user of this API, and it already sends the default value always, this does not affect
any existing usage.
Since the UI still wants to show a 'match all' button to prevent confusion, but it's not a normal option
(if it were a normal option, it could be combined with others, which isn't meaningful), we add a new key
NoneLabel that indicates the name that should be displayed on this extra button.
Finally, we implement these changes for the k8s namespace button, ie.
- Get rid of All Namespaces option
- Add "All Namespaces" as the NoneLabel
- Default to "" when "default" namespace not present, which is equivalent to the old "all" option.
This is the first usage of the new 'union' selectType.
Note that we're still sending 'all' for now. There's currently no easy
way to specify this meaning, and arguably it should be done entirely clientside.
But for now it just means some UI weirdness where 'all' is one of the options and having it on
means anything else you select doesn't matter.
This field changes the option group behaviour depending on its value.
Currently only supports two values:
"one" (default): Old behaviour, one option can be selected
"union": Any number of options can be selected, and the filters are OR-ed togther
It is written in such a way as to easily enable a future "intersection" option,
as per union but AND-ing the filters. But this is not done here. YAGNI.
This reverts commit 76ddc75fb8, reversing
changes made to 3ade2933eb.
We are rolling this back for now because it's causing a bug where sub-topologies
would have ~3000 repeated cases of the k8s filters, causing performance issues clientside.
To facilitate this, we replace the existing functionality of updateFilters which
sets k8s topologies to have the filters [namespace, managed], to instead append the namespace filter
to any existing. This lets it apply to both k8s and container topologies without overwriting existing
container filters. We instead set the managed filter in the static definition.
This however has the side effect that the ordering of the namespace filter and the managed filter
in k8s topologies has been reversed, so it reads:
Show Unmanaged | Hide Unmanaged
foo | bar | default | baz | All Namespaces
instead of:
foo | bar | default | baz | All Namespaces
Show Unmanaged | Hide Unmanaged
Merge all reports received within a specified interval, discarding the
originals. This improves performance of Report() on repeated
invocation since it ends up merging fewer reports.
For example, if reports are received every second (e.g. 3 probes
reporting at the default probe.publishInterval of 3s), and the
app.windows is 15s (the default) and the report generation interval is
5s (e.g. one UI accessing every TOPOLOGY_INTERVAL; the default), then
the original code would have to merge 15 reports per UI access,
whereas this code will only need to merge 8 to 9 reports (3-4 merged
reports from previous invocation plus 5 recently received reports).
Now you can launch the scope app with something like
./prog/scope --mode=app --weave=false --app.collector=file:///tmp/reports
and if the specified dir contains reports with filenames in the form
<timestamp>.{msgpack|json}[.gz],
e.g. "1488557088545489008.msgpack.gz", then these reports are replayed
in a loop at a sequence and speed determined by the timestamps.
This is an alternate way of solving the same problem as 4007a902a264e5ff2c3be6b269ade515c9c1c145,
but in a nicer way. Compared to using pointers, this approach more obviously preserves the original
behaviour, and is arguably more readable than the original code.
Credit to @rade for this approach.
Symptoms:
> app/control_router.go:44:38: error strings should not be capitalized or end with punctuation or a newline
This is blocking the build on:
https://circleci.com/gh/kinvolk/scope/363