commit | d0ab2ca79066a778b23c6f57bfbaf06a70ad1468 | [log] [tgz] |
---|---|---|
author | Allen Li <ayatane@chromium.org> | Wed Nov 22 11:25:37 2017 -0800 |
committer | chrome-bot <chrome-bot@chromium.org> | Mon Nov 27 22:50:43 2017 -0800 |
tree | 9f62799ba53b5066c676191f5ed699def46f9432 | |
parent | b4e36d56a3ac2e011d1221be0383ca67d32b0221 [diff] [blame] |
sysmon: Fix default type TypeError BUG=chromium:787904 TEST=None Change-Id: Ibc2e48f04c130ba750f901d995deecdb34803348 Reviewed-on: https://chromium-review.googlesource.com/786430 Commit-Ready: Allen Li <ayatane@chromium.org> Tested-by: Allen Li <ayatane@chromium.org> Reviewed-by: Ningning Xia <nxia@chromium.org>
diff --git a/scripts/sysmon/puppet_metrics.py b/scripts/sysmon/puppet_metrics.py index f55efb8..81b0ffd 100644 --- a/scripts/sysmon/puppet_metrics.py +++ b/scripts/sysmon/puppet_metrics.py
@@ -89,7 +89,7 @@ """Return mapping of time information.""" times = self._data.get('time', {}).copy() times.pop('last_run', None) - total = times.pop('total', None) + total = times.pop('total', 0) times['other'] = max(0, total - sum(times.itervalues())) return times