Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1962)

Unified Diff: breakpad.py

Issue 11416230: Only call SendProfile() on slow commands (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: breakpad.py
diff --git a/breakpad.py b/breakpad.py
index 3540b261fece88665b19f2ff07249d314abd8403..2248e35c71837d85608f5615e1649cf6fea907fd 100644
--- a/breakpad.py
+++ b/breakpad.py
@@ -106,12 +106,12 @@ def SendStack(last_tb, stack, url=None, maxlen=50, verbose=True):
p(post(url or DEFAULT_URL + '/breakpad', params))
-def SendProfiling(url=None):
+def SendProfiling(duration, url=None):
params = {
'argv': ' '.join(sys.argv),
# Strip the hostname.
'domain': _HOST_NAME.split('.', 1)[-1],
- 'duration': time.time() - _TIME_STARTED,
+ 'duration': duration,
'platform': sys.platform,
}
post(url or DEFAULT_URL + '/profiling', params)
@@ -126,7 +126,9 @@ def CheckForException():
if last_tb:
SendStack(last_value, ''.join(traceback.format_tb(last_tb)))
else:
- SendProfiling()
+ duration = time.time() - _TIME_STARTED
+ if duration > 90:
+ SendProfiling(duration)
def Register():
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698