Bug 1474208: Use median of all process values for AWSY base content. r=erahm

MozReview-Commit-ID: DBiJjeTlyZE

--HG--
extra : rebase_source : deb1d6265e3d2d77a85e3c5f1b32f274c866a623
This commit is contained in:
Kris Maglione 2018-07-08 11:50:46 -07:00
parent b271e31bd6
commit 0820be3463
2 changed files with 14 additions and 6 deletions

View File

@ -32,6 +32,14 @@ PERF_SUITES = [
{ 'name': "Images", 'node': "explicit/images/" }
]
def median(values):
sorted_ = sorted(values)
med = int(len(sorted_) / 2)
if len(sorted_) % 2:
return sorted_[med]
return (sorted_[med - 1] + sorted_[med]) / 2
def update_checkpoint_paths(checkpoint_files, checkpoints):
"""
Updates checkpoints with memory report file fetched in data_path
@ -85,15 +93,15 @@ def create_suite(name, node, data_path, checkpoints=CHECKPOINTS):
memory_report_path = os.path.join(data_path, checkpoint['path'])
name_filter = checkpoint.get('name_filter', None)
count = checkpoint.get('count', 0)
if checkpoint.get('median'):
process = median
else:
process = sum
if node != "resident":
totals = parse_about_memory.calculate_memory_report_values(
memory_report_path, node, name_filter)
if count:
value = sum(totals.values()[:count])
else:
value = sum(totals.values())
value = process(totals.values())
else:
# For "resident" we really want RSS of the chrome ("Main") process
# and USS of the child processes. We'll still call it resident

View File

@ -17,7 +17,7 @@ CHECKPOINTS = [
'name': "After tabs open [+30s, forced GC]",
'path': "memory-report-TabsOpenForceGC-4.json.gz",
'name_filter': 'Web Content', # We only want the content process
'count': 1 # We only care about the first one
'median': True, # We want the median from all content processes
},
]