Only call SendProfile() on slow commands

Reduce calling SendProfile to long running commands. There's lots of low hanging fruit (slow commands) to optimize before we need perf stats from fast commands.

R=maruel@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/11416230

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@170009 0039d316-1c4b-4281-b951-d872f2087c98
experimental/szager/collated-output
ilevy@chromium.org 12 years ago
parent 8ef7ab251c
commit 43b9910fc2

@ -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():

Loading…
Cancel
Save