|
rpc/apiserver: logging improvements
This is a bunch of tweaks to the RPC logging statements to make them
nicer to use.
1) Add wall-clock time to responses. This lets you see quickly how
long a given RPC took to process.
2) Add a unique identifier per-connection. The code was sort of
written around remoteAddr (it collected it, at least), but it turns
out that isn't actually enough. Roger mentioned using the address of
an object, but those can be reused. Using a unique counter allows us
to both guarantee it is unique for the lifetime of the process, and
makes the numbers significantly smaller. I also went with Hex form
to save a couple bytes, but I'm not wedded to it. I could be
convinced that %d would be better than %x. I did go with [%x] to
ensure that you can search for a stream without hitting
prefix/suffix/etc matches.
3) Once the remote side has logged in, the log messages include the
Tag of that entity. I find that to be quite useful (especially to
clarify unit agents from machine agents, etc). The Facade they are
using is already in the requests (as Type).
This is based on my earlier patch that fixes the API endpoint bugs. I
could pull it out if that patch gets rejected, as it isn't an actual
dependency, just code committed after the other one. I don't expect it
will be an actual problem, though.
https://code.launchpad.net/~jameinel/juju-core/rpc-debugging-info/+merge/193031
Requires: https://code.launchpad.net/~jameinel/juju-core/tweak-cached-address-functionality/+merge/192789
(do not edit description out of merge proposal)
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+339 lines, -890 lines) |
Patch |
|
A |
[revision details]
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
cmd/juju/bootstrap.go
|
View
|
|
1 chunk |
+23 lines, -19 lines |
0 comments
|
Download
|
|
M |
cmd/juju/bootstrap_test.go
|
View
|
|
14 chunks |
+26 lines, -73 lines |
0 comments
|
Download
|
|
M |
cmd/juju/help_topics.go
|
View
|
|
1 chunk |
+0 lines, -4 lines |
0 comments
|
Download
|
|
M |
cmd/juju/upgradejuju_test.go
|
View
|
|
4 chunks |
+5 lines, -2 lines |
0 comments
|
Download
|
|
M |
environs/bootstrap/bootstrap_test.go
|
View
|
|
1 chunk |
+0 lines, -4 lines |
0 comments
|
Download
|
|
M |
environs/config/config_test.go
|
View
|
|
1 chunk |
+0 lines, -2 lines |
0 comments
|
Download
|
|
M |
environs/interface.go
|
View
|
|
2 chunks |
+1 line, -4 lines |
0 comments
|
Download
|
|
M |
environs/manual/provisioner_test.go
|
View
|
|
2 chunks |
+0 lines, -2 lines |
0 comments
|
Download
|
|
D |
environs/mongo.go
|
View
|
|
1 chunk |
+0 lines, -14 lines |
0 comments
|
Download
|
|
D |
environs/mongo_test.go
|
View
|
|
1 chunk |
+0 lines, -76 lines |
0 comments
|
Download
|
|
M |
environs/simplestreams/simplestreams.go
|
View
|
|
8 chunks |
+52 lines, -12 lines |
0 comments
|
Download
|
|
M |
environs/simplestreams/simplestreams_test.go
|
View
|
|
10 chunks |
+32 lines, -10 lines |
0 comments
|
Download
|
|
M |
environs/simplestreams/testing/testing.go
|
View
|
|
2 chunks |
+11 lines, -5 lines |
0 comments
|
Download
|
|
M |
environs/sync/sync.go
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
environs/testing/tools.go
|
View
|
|
1 chunk |
+0 lines, -2 lines |
0 comments
|
Download
|
|
M |
environs/tools/simplestreams.go
|
View
|
|
5 chunks |
+2 lines, -20 lines |
0 comments
|
Download
|
|
M |
environs/tools/urls_test.go
|
View
|
|
2 chunks |
+2 lines, -6 lines |
0 comments
|
Download
|
|
M |
provider/azure/config.go
|
View
|
|
4 chunks |
+8 lines, -34 lines |
0 comments
|
Download
|
|
M |
provider/azure/config_test.go
|
View
|
|
5 chunks |
+10 lines, -52 lines |
0 comments
|
Download
|
|
M |
provider/azure/environ.go
|
View
|
|
5 chunks |
+2 lines, -37 lines |
0 comments
|
Download
|
|
M |
provider/azure/environ_test.go
|
View
|
|
3 chunks |
+1 line, -38 lines |
0 comments
|
Download
|
|
M |
provider/azure/environprovider_test.go
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
provider/azure/storage.go
|
View
|
|
1 chunk |
+0 lines, -16 lines |
0 comments
|
Download
|
|
M |
provider/dummy/environs.go
|
View
|
|
4 chunks |
+14 lines, -22 lines |
0 comments
|
Download
|
|
M |
provider/dummy/storage.go
|
View
|
|
3 chunks |
+3 lines, -19 lines |
0 comments
|
Download
|
|
M |
provider/ec2/config.go
|
View
|
|
3 chunks |
+7 lines, -22 lines |
0 comments
|
Download
|
|
M |
provider/ec2/config_test.go
|
View
|
|
3 chunks |
+2 lines, -43 lines |
0 comments
|
Download
|
|
M |
provider/ec2/ec2.go
|
View
|
|
5 chunks |
+7 lines, -27 lines |
0 comments
|
Download
|
|
M |
provider/ec2/export_test.go
|
View
|
|
1 chunk |
+0 lines, -10 lines |
0 comments
|
Download
|
|
M |
provider/ec2/live_test.go
|
View
|
|
4 chunks |
+0 lines, -23 lines |
0 comments
|
Download
|
|
M |
provider/ec2/local_test.go
|
View
|
|
5 chunks |
+10 lines, -26 lines |
0 comments
|
Download
|
|
M |
provider/local/environ.go
|
View
|
|
1 chunk |
+0 lines, -5 lines |
0 comments
|
Download
|
|
M |
provider/local/environ_test.go
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
provider/maas/environ.go
|
View
|
|
1 chunk |
+0 lines, -6 lines |
0 comments
|
Download
|
|
M |
provider/maas/environ_test.go
|
View
|
|
1 chunk |
+0 lines, -7 lines |
0 comments
|
Download
|
|
M |
provider/null/environ.go
|
View
|
|
1 chunk |
+0 lines, -4 lines |
0 comments
|
Download
|
|
D |
provider/openstack/certifiedclouds.go
|
View
|
|
1 chunk |
+0 lines, -25 lines |
0 comments
|
Download
|
|
D |
provider/openstack/certifiedclouds_test.go
|
View
|
|
1 chunk |
+0 lines, -35 lines |
0 comments
|
Download
|
|
M |
provider/openstack/config.go
|
View
|
|
3 chunks |
+0 lines, -21 lines |
0 comments
|
Download
|
|
M |
provider/openstack/config_test.go
|
View
|
|
3 chunks |
+0 lines, -24 lines |
0 comments
|
Download
|
|
M |
provider/openstack/export_test.go
|
View
|
|
4 chunks |
+4 lines, -11 lines |
0 comments
|
Download
|
|
M |
provider/openstack/live_test.go
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
provider/openstack/local_test.go
|
View
|
|
4 chunks |
+5 lines, -73 lines |
0 comments
|
Download
|
|
M |
provider/openstack/provider.go
|
View
|
|
2 chunks |
+0 lines, -22 lines |
0 comments
|
Download
|
|
M |
rpc/rpc_test.go
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
rpc/server.go
|
View
|
|
8 chunks |
+9 lines, -6 lines |
0 comments
|
Download
|
|
M |
state/apiserver/admin.go
|
View
|
|
3 chunks |
+10 lines, -5 lines |
0 comments
|
Download
|
|
M |
state/apiserver/apiserver.go
|
View
|
|
4 chunks |
+26 lines, -6 lines |
0 comments
|
Download
|
|
M |
state/apiserver/login_test.go
|
View
|
|
4 chunks |
+59 lines, -9 lines |
0 comments
|
Download
|
Total messages: 1
|