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

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

Issue 1029263003: [telemetry] Sort imports in Telemetry and its dependents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ensure we're up to date. Created 5 years, 9 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 os
5 import tempfile 6 import tempfile
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
11 class HistoryProfileExtender( 11 class HistoryProfileExtender(
12 fast_navigation_profile_extender.FastNavigationProfileExtender): 12 fast_navigation_profile_extender.FastNavigationProfileExtender):
13 """This extender navigates Chrome to a large number of URIs pointing to local 13 """This extender navigates Chrome to a large number of URIs pointing to local
14 files. It continues running until the history DB becomes full.""" 14 files. It continues running until the history DB becomes full."""
15 _HISTORY_DB_MAX_SIZE_IN_MB = 10 15 _HISTORY_DB_MAX_SIZE_IN_MB = 10
16 16
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
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**20 87 bytes_in_megabyte = 2**20
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
« no previous file with comments | « tools/perf/page_sets/tough_webgl_cases.py ('k') | tools/perf/profile_creators/history_profile_extender_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698