Commit Graph

432 Commits

Author SHA1 Message Date
Bryan Boreham
b772fa83b3 Add a metric for topologies dropped because they are over limit
Need to modify DropTopologiesOver() to report what it dropped, and
plumb through the userid so the metric can show who has a problem.
2020-04-16 19:27:28 +00:00
Bryan Boreham
f66e91e37f Merge pull request #3748 from weaveworks/move-counters-to-latest
Move Counters into Latest
2020-03-11 21:14:01 +00:00
Bryan Boreham
c03aeb5d43 Move Counters into Latest
The only place Counters are used is in rendering, for the number of
nodes under a topology, so the overhead of holding a unique data
structure in every Node is unwarranted.

Counters are not set in the probe, so we don't need any
backwards-compatibility in report decoding. Similarly they are not set
until after all nodes are merged, so we don't need that logic.
2020-03-10 12:30:05 +00:00
Bryan Boreham
3098267be4 Add a timestamp on each report saying when it was generated
Not currently used in the code, but useful when troubleshooting.
2020-03-06 15:39:06 +00:00
Bryan Boreham
a47cf0a2aa Remove copying Merge() on Report
It was only used in a few places, and all of those were better off
using the Unsafe variant.
2020-03-06 15:03:43 +00:00
Bryan Boreham
574c76ac40 Merge pull request #3709 from weaveworks/report-endpoint-subset
Report a subset of connections from/to the same endpoint
2020-01-27 22:42:47 +00:00
Bryan Boreham
a375a54546 Merge pull request #3714 from weaveworks/simplify-control-serialisation
performance: send active controls as a single string per node
2020-01-23 12:15:21 +00:00
Bryan Boreham
2171e21cae Ensure ugorji code-generation dependencies are vendored 2020-01-13 17:27:13 +00:00
Bryan Boreham
1dcdfab05a fixup: from review feedback
Fix a logic error in ECS scale-down button, bad copy/paste in
ActiveControls() and neaten the switch cases in container controls.

Co-Authored-By: Filip Barl <filip@weave.works>
2020-01-13 14:48:38 +00:00
Bryan Boreham
de3c34ddc6 performance(probe): thin out many connections between the same point
The app will only show one line, regardless of how many connections we
have, so reduce the number to save bandwidth and rendering time.

We filter by choosing a modulus, e.g. send every connection that is a
multiple of 3, or 9, and so on. We avoid multiples of 2 because port
numbers are often a multiple of 2 or 4 for bit-encoding reasons.
2020-01-13 08:53:47 +00:00
Bryan Boreham
635cea0b56 backwards-compatibility: unmarshall latestControls data from older probes
With a test.
2019-11-26 11:31:44 +00:00
Bryan Boreham
eb381f167d refactor: move Report backwards-compatibility code into its own file
Makes report.go a little easier to read.
2019-11-26 11:31:44 +00:00
Bryan Boreham
85d2f6309c performance: Send active controls as a single string per node
Instead of a whole extra data structure which is quite expensive to
marshal and unmarshal, just send the information in a string.  No
clever merging strategy is required - the states are all set in one
place per node type.
2019-11-26 11:29:42 +00:00
Bryan Boreham
b9c71f30d6 Update comments based on review feedback 2019-10-17 10:38:58 +00:00
Bryan Boreham
6ccbd2d0cf Fix accidental rename of DNS to 'nodes'
In commit 951629af29 the `DNS` field was accidentally renamed in
serialised data to `nodes`.  Put it back, and also add a field to fix
up data coming from a probe with that fault.
2019-10-14 15:08:39 +00:00
Bryan Boreham
23d8a418e1 performance: network namespace ID is a 32-bit quantity
This shrinks some data-structures slightly.

Citation: https://github.com/torvalds/linux/blob/6f0d349d922b/include/linux/ns_common.h#L10
2019-10-04 13:11:30 +00:00
Bryan Boreham
7b4fa141d3 fix: add back check on missing namespace in MakeEndpointNodeIDB() 2019-09-27 15:08:31 +00:00
Bryan Boreham
2941850a75 performance: in connection tracker, hold IP addresses in binary rather than strings
This is more compact, and saves effort converting to and from the string format.
2019-09-25 20:15:05 +00:00
Akash Srivastava
ca420b07aa Merge pull request #3687 from weaveworks/refactor-reading
Refactor report reading
2019-09-24 12:26:01 +05:30
Bryan Boreham
13af359bcf refactor: eliminate report.ReadBinary() in favour of MakeFromBinary()
The signature of MakeFromFile changed to return a pointer for
consistency.
2019-09-23 10:01:43 +00:00
Bryan Boreham
f675c87826 Merge pull request #3680 from weaveworks/remove-old-control-code
refactor: remove old unnecessary controls code
2019-09-19 09:32:19 +01:00
Bryan Boreham
6ee9738581 Merge pull request #3686 from weaveworks/analyze-reports
feature(app): Add a debugging summary function, exposed via http
2019-09-18 15:54:50 +01:00
Bryan Boreham
57918b0ac5 formatting 2019-09-18 14:43:49 +00:00
Bryan Boreham
a7d3cbedb5 lint: make lint happy 2019-09-18 14:42:47 +00:00
Bryan Boreham
da030d1618 test: add TestReportUnMerge()
Testing the new delta-report internals
2019-09-18 08:01:13 +00:00
Bryan Boreham
951629af29 chore: allow Report.DNS field to be nil
Primarily to help when writing tests; may give a tiny performance benefit.
2019-09-18 08:00:28 +00:00
Bryan Boreham
b6d5594f9f perf(probe): publish delta reports to reduce data size
Similar to video compression which uses key-frames and differences
between them: every N publishes we send a full report, but inbetween
we only send what has changed.

Fairly simple approach in the probe - hold on to the last full report,
and for the deltas remove anything that would be merged in from the
full report.

On the receiving side in the app it already merges a set of reports
together to produce the final output for rendering, so provided N is
smaller than that set we don't need to do anything different.

Deltas don't need to represent nodes that have disappeared - an
earlier full node will have that node so it would be merged into the
final output anyway.
2019-09-18 08:00:28 +00:00
Bryan Boreham
a811afdba1 Merge pull request #3678 from weaveworks/nodes-omitempty
perf(probe): add 'omitempty' tag to Topology.Nodes
2019-09-17 16:25:52 +01:00
Bryan Boreham
5ffb563051 refactor: eliminate ReadBytes() function that is only called once 2019-09-17 10:55:44 +00:00
Bryan Boreham
2bbd4a3f0d refactor: remove MakeFromBytes() function which is almost the same as ReadBinary() 2019-09-17 10:55:44 +00:00
Bryan Boreham
3f8ba95bea refactor: pass msgpack flag into ReadBinary
instead of a codec.Handle.  This is a cleaner dependency.
2019-09-17 10:55:44 +00:00
Bryan Boreham
11e76f1740 feature(app): Add a debugging summary function, exposed via http
URL is /admin/summary
2019-09-17 10:48:23 +00:00
Bryan Boreham
871751873b Stop render package depending on probe
This dependency makes it harder to see the structure of the program,
and sometimes complicates compilation.

Mostly just changing the source of strings that are already exported
from the report package.  A few new strings have to be moved there,
plus the function `IsPauseImageName()`.
2019-09-15 17:03:04 +00:00
Bryan Boreham
4c52889316 Add 'omitempty' tag to Topology.Nodes
So we save space writing out empty topologies.

Need to fix up `app_client_internal_test.go` to use Scope's
`test/reflect` package that understands empty==nil, so now it doesn't
need a previous workaround.

Remove a similar workaround in `probe_internal_test.go` that isn't
necessary since it's already using that package.
2019-09-15 15:50:08 +00:00
Bryan Boreham
b9b7d03354 refactor: remove old unnecessary controls code
Scope stopped using NodeControls in bd43c34852, and since
1cfc8f4581 WireMetrics is identical to Metrics so unnecessary.
2019-09-14 22:11:28 +00:00
Bryan Boreham
15467d7310 Move host-related names out of probe code
Reduce the dependency on low-level libraries
2019-09-13 11:41:09 +00:00
Satyam Zode
6c4b01dcd9 Change shape of K8s Job to dottedtriangle
Signed-off-by: Satyam Zode <satyamzode@gmail.com>
2019-05-20 16:55:48 +05:30
Satyam Zode
36361d6b7d Add Kubernetes Job support to Weave Scope
This covers:
- Implementation of the job resource in probe
- Reporter changes for the job
- Add Describe Control to the job
- Pass job object to the kube controller renderer

ToDo:
- Need to decide the shape for the Job.

Signed-off-by: Satyam Zode <satyamzode@gmail.com>
2019-05-19 02:36:45 +05:30
Filip Barl
cdc33855d4 Merge pull request #3589 from openebs/feature/kubectl-describe
Add describe control to all k8s resources
2019-05-17 13:37:15 +02:00
Bryan Boreham
711aa66bd5 Add OpenTracing span for report.ReadBinary()
So we can see the timing and size in Jaeger.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2019-05-10 15:34:53 +00:00
Akash Srivastava
029bbbcec8 Add describe control to all k8s resources
This commit will add a new control i.e. Describe
which will describe a k8s resource similar to kubectl describe.

Signed-off-by: Akash Srivastava <akashsrivastava4927@gmail.com>
2019-04-01 11:22:12 +05:30
Filip Barl
e66a3e08dc Add a confirmation dialog for deleting a pod. 2019-02-26 11:57:00 +01:00
Filip Barl
b9e692c3b3 Lock the time in tests to make them pass. 2019-02-25 11:35:33 +01:00
Filip Barl
353ab75ddb Added some tests for censoring. 2019-02-23 19:30:42 +01:00
Filip Barl
c5022bd2bb Code cleanup. 2019-02-22 14:56:44 +01:00
Filip Barl
2c56ec2bf1 Made censoring work properly. 2019-02-21 16:46:17 +01:00
Filip Barl
0f1b7e5972 Prepare to filter node summaries post-render. 2019-02-21 16:18:24 +01:00
Filip Barl
3c5320ef09 Polished the code and applied censoring to other API endpoints. 2019-02-21 14:34:05 +01:00
Filip Barl
97fdcdc525 Option to censor raw reports by command line args and env vars. 2019-02-15 17:31:08 +01:00
Bryan Boreham
ee0ce7b087 Merge pull request #3384 from weaveworks/drop-big-topologies
In multitenant app, drop all nodes for big topologies
2018-11-01 17:21:55 +00:00