Bug 1474208: Use median of all process values for AWSY base content. r?erahm
MozReview-Commit-ID: DBiJjeTlyZE
--- a/testing/awsy/awsy/process_perf_data.py
+++ b/testing/awsy/awsy/process_perf_data.py
@@ -27,16 +27,24 @@ CHECKPOINTS = [
PERF_SUITES = [
{ 'name': "Resident Memory", 'node': "resident" },
{ 'name': "Explicit Memory", 'node': "explicit/" },
{ 'name': "Heap Unclassified", 'node': "explicit/heap-unclassified" },
{ 'name': "JS", 'node': "js-main-runtime/" },
{ '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
:param checkpoint_files: list of files in data_path
:param checkpoints: The checkpoints to update the path of.
"""
target_path = [['Start-', 0],
['StartSettled-', 0],
@@ -80,25 +88,25 @@ def create_suite(name, node, data_path,
suite['extraOptions'] = ["stylo-sequential"]
update_checkpoint_paths(glob.glob(os.path.join(data_path, "memory-report*")), checkpoints)
total = 0
for checkpoint in 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
# for simplicity (it's nice to be able to compare RSS of non-e10s
# with RSS + USS of e10s).
totals_rss = parse_about_memory.calculate_memory_report_values(
memory_report_path, node, 'Main')
totals_uss = parse_about_memory.calculate_memory_report_values(
--- a/testing/awsy/awsy/test_base_memory_usage.py
+++ b/testing/awsy/awsy/test_base_memory_usage.py
@@ -12,17 +12,17 @@ if AWSY_PATH not in sys.path:
from awsy.awsy_test_case import AwsyTestCase
# A description of each checkpoint and the root path to it.
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
},
]
# A description of each perfherder suite and the path to its values.
PERF_SUITES = [
{ 'name': "Base Content Resident Unique Memory", 'node': "resident-unique" },
{ 'name': "Base Content Heap Unclassified", 'node': "explicit/heap-unclassified" },
{ 'name': "Base Content JS", 'node': "js-main-runtime/" },