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

Unified Diff: tools/perf/page_sets/blob_workshop.py

Issue 1104053006: [Storage] Blob Storage perf tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added read stats Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: tools/perf/page_sets/blob_workshop.py
diff --git a/tools/perf/page_sets/blob_workshop.py b/tools/perf/page_sets/blob_workshop.py
new file mode 100644
index 0000000000000000000000000000000000000000..5c082ebaf51cfd1f39864e919b425c33960d5c5a
--- /dev/null
+++ b/tools/perf/page_sets/blob_workshop.py
@@ -0,0 +1,79 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+from telemetry.page import page as page_module
+from telemetry.page import page_test as page_test
+from telemetry.page import page_set as page_set_module
+
nednguyen 2015/05/18 22:55:54 ditto
dmurph 2015/05/21 00:21:36 Done.
+class BlobWorkshopPage(page_module.Page):
+ def __init__(self, write_method, blob_sizes, read_method, page_set):
+ super(BlobWorkshopPage, self).__init__(url='file://blob/blob-workshop.html', page_set=page_set)
nednguyen 2015/05/18 22:55:54 You may want to define the 'name' for these pages,
dmurph 2015/05/21 00:21:36 Done.
+ self.blob_sizes = blob_sizes
nednguyen 2015/05/18 22:55:54 Make this and the other 3 field members private
dmurph 2015/05/21 00:21:36 Done.
+ self.read_method = read_method
+ self.write_method = write_method
+
+ def RunNavigateSteps(self, action_runner):
+ url = self.file_path_url_with_scheme if self.is_file else self.url
+ action_runner.Navigate(
+ url, script_to_evaluate_on_commit=self.script_to_evaluate_on_commit)
nednguyen 2015/05/18 22:55:54 3 lines above can be removed and you can use put t
dmurph 2015/05/21 00:21:36 Done.
+
+ action_runner.ExecuteJavaScript('disableUI = true;')
+
+ # Add blobs
+ for size_bytes in self.blob_sizes:
+ with action_runner.CreateInteraction('Action_CreateBlob',
+ repeatable=True):
+ action_runner.ExecuteJavaScript('createBlob(' + str(size_bytes) + ');')
+
+ # Read blobs
+ with action_runner.CreateInteraction('Action_ReadBlob'):
+ if self.read_method is 'serial':
+ action_runner.ExecuteJavaScript('readBlobsSerially();')
+ else:
+ action_runner.ExecuteJavaScript('readBlobsInParallel();')
+ action_runner.WaitForJavaScriptCondition('doneReading === true', 60)
+
+ errors = action_runner.EvaluateJavaScript('errors')
+ if (errors):
nednguyen 2015/05/18 22:55:54 unnecessary parens
dmurph 2015/05/21 00:21:36 Done.
+ raise page_test.Failure('Errors on page: ' + ', '.join(self.errors))
+
+class BlobWorkshopPageSet(page_set_module.PageSet):
+ """The BlobWorkshop page."""
+
+ def __init__(self):
+ super(BlobWorkshopPageSet, self).__init__()
+ self.AddUserStory(BlobWorkshopPage('2Bx200',
+ [2] * 200, 'serial', self))
+ self.AddUserStory(BlobWorkshopPage('2Bx200',
+ [2] * 200, 'parallel', self))
+
+ self.AddUserStory(BlobWorkshopPage('1KBx200',
+ [1024] * 200, 'serial', self))
+ self.AddUserStory(BlobWorkshopPage('1KBx200',
+ [1024] * 200, 'parallel', self))
+
+ self.AddUserStory(BlobWorkshopPage('150KBx200',
+ [150 * 1024 - 1] * 200,
+ 'serial', self))
+ self.AddUserStory(BlobWorkshopPage('150KBx200',
+ [150 * 1024 - 1] * 200,
+ 'parallel', self))
+
+ self.AddUserStory(BlobWorkshopPage('1MBx200',
+ [1024 * 1024] * 200, 'serial', self))
+ self.AddUserStory(BlobWorkshopPage('1MBx200',
+ [1024 * 1024] * 200, 'parallel', self))
+
+ self.AddUserStory(BlobWorkshopPage('10MBx20',
+ [10 * 1024 * 1024] * 30,
+ 'serial', self))
+ self.AddUserStory(BlobWorkshopPage('10MBx20',
+ [10 * 1024 * 1024] * 30,
+ 'parallel', self))
+
+ self.AddUserStory(BlobWorkshopPage('100MBx5',
+ [100 * 1024 * 1024] * 5,
+ 'serial', self))
+ self.AddUserStory(BlobWorkshopPage('100MBx5',
+ [100 * 1024 * 1024] * 5,
+ 'parallel', self))

Powered by Google App Engine
This is Rietveld 408576698