linkerd2/controller/api/public
Kevin Leimkuhler 229e33e79e
cli: Always display stat tables for all routes (#2466)
## Problem

When an object has no previous route metrics, we do not generate a table for
that object.

The reasoning behind this was for reducing output of the following command:

```
$ linkerd routes deploy --to deploy/foo
```

For each deployment object, if it has no previous traffic to `deploy/foo`, then
a table would not be generated for it.

However, the behavior we see with that indicates there is an error even when a
Service Profile is installed:

```
$ linkerd routes deploy deploy/foo
Error: No Service Profiles found for selected resources
```

## Solution

Always generate a stat table for the queried resource object.

## Validation

I deployed [booksapp](https://github.com/buoyantIO/booksapp) with the `traffic`
deployment removed and Service Profiles installed.

Without the fix, `linkerd routes deploy/webapp` displays an error because there
has been no traffic to `deploy/webapp` without the `traffic` deployment.

With the fix, the following output is generated:

```
ROUTE                       SERVICE   SUCCESS      RPS   LATENCY_P50   LATENCY_P95   LATENCY_P99
GET /                        webapp     0.00%   0.0rps           0ms           0ms           0ms
GET /authors/{id}            webapp     0.00%   0.0rps           0ms           0ms           0ms
GET /books/{id}              webapp     0.00%   0.0rps           0ms           0ms           0ms
POST /authors                webapp     0.00%   0.0rps           0ms           0ms           0ms
POST /authors/{id}/delete    webapp     0.00%   0.0rps           0ms           0ms           0ms
POST /authors/{id}/edit      webapp     0.00%   0.0rps           0ms           0ms           0ms
POST /books                  webapp     0.00%   0.0rps           0ms           0ms           0ms
POST /books/{id}/delete      webapp     0.00%   0.0rps           0ms           0ms           0ms
POST /books/{id}/edit        webapp     0.00%   0.0rps           0ms           0ms           0ms
[DEFAULT]                    webapp     0.00%   0.0rps           0ms           0ms           0ms
```

Closes #2328

Signed-off-by: Kevin Leimkuhler <kevinl@buoyant.io>
2019-03-11 14:17:20 -07:00
..
testdata Public API endpoint `Config()` (#2455) 2019-03-07 17:37:46 -05:00
client.go Public API endpoint `Config()` (#2455) 2019-03-07 17:37:46 -05:00
client_test.go lint: Enable unparam (#2369) 2019-02-27 10:34:02 -08:00
grpc_server.go Public API endpoint `Config()` (#2455) 2019-03-07 17:37:46 -05:00
grpc_server_test.go Fix web init to not check for ServiceProfiles (#2470) 2019-03-07 15:20:46 -08:00
http_server.go Public API endpoint `Config()` (#2455) 2019-03-07 17:37:46 -05:00
http_server_test.go Public API endpoint `Config()` (#2455) 2019-03-07 17:37:46 -05:00
prometheus.go Modify StatSummary to also return TCP stats (#2262) 2019-02-25 10:37:39 -08:00
proto_over_http.go lint: Enable unparam (#2369) 2019-02-27 10:34:02 -08:00
proto_over_http_test.go lint: Enable unparam (#2369) 2019-02-27 10:34:02 -08:00
stat_summary.go lint: Enable unparam (#2369) 2019-02-27 10:34:02 -08:00
stat_summary_test.go Require cluster-wide k8s API access (#2428) 2019-03-07 10:23:18 -08:00
test_helper.go Public API endpoint `Config()` (#2455) 2019-03-07 17:37:46 -05:00
top_routes.go cli: Always display stat tables for all routes (#2466) 2019-03-11 14:17:20 -07:00
top_routes_test.go Wire up stats for Jobs (#2416) 2019-03-01 17:16:54 -08:00