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

Side by Side Diff: tools/android/loading/network_activity_lens.py

Issue 1972413002: clovis: Silence noisy NetworkActivityLens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Gives a picture of the network activity between timestamps.""" 5 """Gives a picture of the network activity between timestamps."""
6 6
7 import bisect 7 import bisect
8 import collections 8 import collections
9 import itertools 9 import itertools
10 import operator 10 import operator
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 return self._request.data_chunks[self._chunk_index][1] 230 return self._request.data_chunks[self._chunk_index][1]
231 231
232 def UploadRate(self): 232 def UploadRate(self):
233 """Returns the upload rate of this event in Bytes / s.""" 233 """Returns the upload rate of this event in Bytes / s."""
234 return 1000 * self.UploadedBytes() / float(self.end_msec - self.start_msec) 234 return 1000 * self.UploadedBytes() / float(self.end_msec - self.start_msec)
235 235
236 def DownloadRate(self): 236 def DownloadRate(self):
237 """Returns the download rate of this event in Bytes / s.""" 237 """Returns the download rate of this event in Bytes / s."""
238 downloaded_bytes = self.DownloadedBytes() 238 downloaded_bytes = self.DownloadedBytes()
239 value = 1000 * downloaded_bytes / float(self.end_msec - self.start_msec) 239 value = 1000 * downloaded_bytes / float(self.end_msec - self.start_msec)
240 if value > 1e6:
241 print self._kind, downloaded_bytes, self.end_msec - self.start_msec
242 return value 240 return value
OLDNEW
« 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