Browse files

Ignore GetSystemStatsRequest in duplicate RPC detection.

Summary:
The memory profiler generates a lot of repeated calls to runtime.memory_usage()
on prod.  These get marked as duplicate RPCs, even though they are intentional.
More generally, two calls to the runtime API may return different data, and
were likely intentionally duplicated, so they should not get marked as such in
the profiler.

Test Plan:
Load /stats/memory (which makes multiple runtime.memory_usage() calls), check
that they are no longer marked as duplicate RPCs.

Reviewers: alan

Reviewed By: alan

Differential Revision: http://phabricator.khanacademy.org/D10411
  • Loading branch information...
1 parent 1b5fda0 commit 729ea77f2147c3261ca4467fcc832bd638a1c004 @benjaminjkraft benjaminjkraft committed Jun 24, 2014
Showing with 5 additions and 1 deletion.
  1. +5 −1 appstats_profiler.py
View
6 appstats_profiler.py
@@ -80,7 +80,11 @@ def results(self):
request = trace.request_data_summary()
response = trace.response_data_summary()
- likely_dupe = request in requests_set
+ # GetSystemStatsRequest is time-dependent, so repeated calls are
+ # likely intentional for profiling purposes. In particular, the
+ # memory sampling profiler generates a lot of these RPCs in prod.
+ likely_dupe = (request in requests_set
+ and not 'GetSystemStatsRequest' in request)
likely_dupes = likely_dupes or likely_dupe
requests_set.add(request)

0 comments on commit 729ea77

Please sign in to comment.