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

Side by Side Diff: tools/perf/profile_creators/history_profile_extender.py

Issue 939143004: Telemetry: Fix several small problems in the profile creator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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 import multiprocessing 4 import multiprocessing
5 import tempfile 5 import tempfile
6 import os 6 import os
7 7
8 from profile_creators import fast_navigation_profile_extender 8 from profile_creators import fast_navigation_profile_extender
9 9
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 os.remove(path) 77 os.remove(path)
78 self._generated_temp_files = [] 78 self._generated_temp_files = []
79 79
80 def _IsHistoryDBAtMaxSize(self): 80 def _IsHistoryDBAtMaxSize(self):
81 """Whether the history DB has reached its maximum size.""" 81 """Whether the history DB has reached its maximum size."""
82 history_db_path = os.path.join(self.profile_path, "Default", "History") 82 history_db_path = os.path.join(self.profile_path, "Default", "History")
83 stat_info = os.stat(history_db_path) 83 stat_info = os.stat(history_db_path)
84 size = stat_info.st_size 84 size = stat_info.st_size
85 85
86 max_size_threshold = 0.95 86 max_size_threshold = 0.95
87 bytes_in_megabyte = 2**10 87 bytes_in_megabyte = 2**20
nednguyen 2015/02/19 20:05:04 Can you do this change in a different patch?
erikchen 2015/02/19 21:55:12 Done.
88 max_size = (bytes_in_megabyte * 88 max_size = (bytes_in_megabyte *
89 HistoryProfileExtender._HISTORY_DB_MAX_SIZE_IN_MB * max_size_threshold) 89 HistoryProfileExtender._HISTORY_DB_MAX_SIZE_IN_MB * max_size_threshold)
90 return size > max_size 90 return size > max_size
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698