Chromium Code Reviews| Index: build/android/pylib/surface_stats_collector.py |
| diff --git a/build/android/pylib/surface_stats_collector.py b/build/android/pylib/surface_stats_collector.py |
| index d5709fffe7d72159f45e5824cfcf075fc8f949e4..00516fedd3d13d4a405f1d45e5ec4ee479dc0564 100644 |
| --- a/build/android/pylib/surface_stats_collector.py |
| +++ b/build/android/pylib/surface_stats_collector.py |
| @@ -85,6 +85,15 @@ class SurfaceStatsCollector(object): |
| deltas = [t2 - t1 for t1, t2 in zip(data, data[1:])] |
| return (deltas, [delta / refresh_period for delta in deltas]) |
| + def _CalcFpsInBuckets(self, timestamps): |
| + for pct in [0.9, 0.5]: |
| + sliced = timestamps[int(-pct * len(timestamps)) + 3 : ] |
|
Sami
2013/07/03 15:11:50
Probably want to bail out here if there were too f
bulach
2013/07/03 18:09:15
when is the "legacy" method used? the non-legacy g
Sami
2013/07/03 18:21:37
Ah, good point. The legacy path is only used on pr
|
| + seconds = sliced[-1] - sliced[0] |
| + frame_count = len(sliced) |
| + self._results.append(SurfaceStatsCollector.Result( |
| + 'avg_surface_fps_' + str(pct).replace('.', '_'), |
|
Sami
2013/07/03 15:11:50
int(pct * 100) would gives nicer names I think :)
bulach
2013/07/03 18:09:15
indeed! done.
|
| + int(round(frame_count / seconds)), 'fps')) |
| + |
| def _StorePerfResults(self): |
| if self._use_legacy_method: |
| surface_after = self._GetSurfaceStatsLegacy() |
| @@ -122,6 +131,7 @@ class SurfaceStatsCollector(object): |
| 'frame_lengths', normalized_frame_lengths, 'vsyncs')) |
| self._results.append(SurfaceStatsCollector.Result( |
| 'avg_surface_fps', int(round(frame_count / seconds)), 'fps')) |
| + self._CalcFpsInBuckets(timestamps) |
|
Sami
2013/07/03 15:11:50
If we decide to go ahead with this, let's include
bulach
2013/07/03 18:09:15
I need to understand this better though: they all
Sami
2013/07/03 18:21:37
|refresh_period| is a constant given by the displa
|
| def _CollectorThread(self): |
| last_timestamp = 0 |