[autotest] Move rpc stats down the stack to cover all attempted RPCs.
This will log all RPCs, afe and tko, and even ones that error out or
don't make sense. This should let us get a realistic view of the RPC
load on our systems.
TEST=restarted apache, saw stats on chromeos-stats/
DEPLOY=apache
BUG=None
Change-Id: I8223347e86b358fa97c44f956c656a380edb3c48
Reviewed-on: https://chromium-review.googlesource.com/176591
Reviewed-by: Alex Miller <milleral@chromium.org>
Commit-Queue: Alex Miller <milleral@chromium.org>
Tested-by: Alex Miller <milleral@chromium.org>
diff --git a/frontend/afe/json_rpc/serviceHandler.py b/frontend/afe/json_rpc/serviceHandler.py
index 50ea45f..cd6a0f3 100644
--- a/frontend/afe/json_rpc/serviceHandler.py
+++ b/frontend/afe/json_rpc/serviceHandler.py
@@ -22,6 +22,7 @@
import traceback
from json import decoder, encoder
+from autotest_lib.site_utils.graphite import stats
def customConvertJson(value):
"""\
@@ -91,6 +92,8 @@
except KeyError:
raise BadServiceRequest(request)
+ stats.Counter('rpc').increment(methName)
+
try:
meth = self.findServiceEndpoint(methName)
results['result'] = self.invokeServiceEndpoint(meth, args)