Commit ff61524b authored by Juan Antonio Navarro Perez's avatar Juan Antonio Navarro Perez Committed by Commit Bot

[pinboard] Compute averages over a fixed set of stories

Sometimes stories get disabled or removed, causing averages to shift due
to the different workloads of the stories that remain.

This CL specifies a fixed set of stories to use when computing averages
over the entire timeseries.

Note: To recompute averages for values in the past one needs to
remove the file _cached_data/pinboard/aggregated.pkl and run pinboard
again.

Bug: 958736
Change-Id: I3b5ec9ca57c74f61f16466c387b3b99b6edb687d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1680186
Commit-Queue: Juan Antonio Navarro Pérez <perezju@chromium.org>
Reviewed-by: default avatarRoss McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#673280}
parent ab4931b6
......@@ -43,6 +43,28 @@ MEASUREMENTS = set([
'V8-Only:duration',
])
# Compute averages over a fixed set of active stories. These may need to be
# periodically updated.
ACTIVE_STORIES = set([
'browse:chrome:newtab',
'browse:chrome:omnibox',
'browse:media:facebook_photos',
'browse:media:googleplaystore:2019',
'browse:media:imgur',
'browse:media:youtube',
'browse:news:cricbuzz',
'browse:news:toi',
'browse:shopping:amazon',
'browse:shopping:lazada',
'browse:social:facebook',
'browse:social:instagram',
'browse:tools:maps',
'load:media:facebook_photos',
'load:media:youtube:2018',
'load:news:irctc',
'load:news:wikipedia:2018'
])
def StartPinpointJobs(state, date):
"""Start new pinpoint jobs for the last commit on the given date."""
......@@ -179,8 +201,9 @@ def GetRevisionResults(item):
assert df['change'].str.contains(item['revision']).all(), (
'Not all results match the expected git revision')
# Filter out and keep only the measurements we want.
# Filter out and keep only the measurements and stories that we want.
df = df[df['name'].isin(MEASUREMENTS)]
df = df[df['story'].isin(ACTIVE_STORIES)]
if not df.empty:
# Aggregate over the results of individual stories.
......
......@@ -168,7 +168,10 @@ class PinboardToolTests(unittest.TestCase):
with open(filename, 'w') as f:
f.writelines(csv)
df = pinboard.GetRevisionResults(item)
with mock.patch('cli_tools.pinboard.pinboard.ACTIVE_STORIES',
new=['story1', 'story2']):
df = pinboard.GetRevisionResults(item)
self.assertEqual(len(df.index), 2) # Only two rows of output.
self.assertTrue((df['revision'] == '2a66ba').all())
self.assertTrue((df['benchmark'] == 'loading').all())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment