| |
| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| <html><head><title>Python: module telemetry.story.story_set</title> |
| <meta charset="utf-8"> |
| </head><body bgcolor="#f0f0f8"> |
| |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> |
| <tr bgcolor="#7799ee"> |
| <td valign=bottom> <br> |
| <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.story.html"><font color="#ffffff">story</font></a>.story_set</strong></big></big></font></td |
| ><td align=right valign=bottom |
| ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/story/story_set.py">telemetry/story/story_set.py</a></font></td></tr></table> |
| <p><tt># Copyright 2014 The Chromium Authors. All rights reserved.<br> |
| # Use of this source code is governed by a BSD-style license that can be<br> |
| # found in the LICENSE file.</tt></p> |
| <p> |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| <tr bgcolor="#aa55cc"> |
| <td colspan=3 valign=bottom> <br> |
| <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> |
| |
| <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> |
| <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.wpr.archive_info.html">telemetry.wpr.archive_info</a><br> |
| </td><td width="25%" valign=top><a href="inspect.html">inspect</a><br> |
| </td><td width="25%" valign=top><a href="os.html">os</a><br> |
| </td><td width="25%" valign=top><a href="telemetry.story.story.html">telemetry.story.story</a><br> |
| </td></tr></table></td></tr></table><p> |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| <tr bgcolor="#ee77aa"> |
| <td colspan=3 valign=bottom> <br> |
| <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> |
| |
| <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> |
| <td width="100%"><dl> |
| <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> |
| </font></dt><dd> |
| <dl> |
| <dt><font face="helvetica, arial"><a href="telemetry.story.story_set.html#StorySet">StorySet</a> |
| </font></dt></dl> |
| </dd> |
| </dl> |
| <p> |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| <tr bgcolor="#ffc8d8"> |
| <td colspan=3 valign=bottom> <br> |
| <font color="#000000" face="helvetica, arial"><a name="StorySet">class <strong>StorySet</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> |
| |
| <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| <td colspan=2><tt>A collection of stories.<br> |
| <br> |
| A typical usage of <a href="#StorySet">StorySet</a> would be to subclass it and then call<br> |
| AddStory for each Story.<br> </tt></td></tr> |
| <tr><td> </td> |
| <td width="100%">Methods defined here:<br> |
| <dl><dt><a name="StorySet-AddStory"><strong>AddStory</strong></a>(self, story)</dt></dl> |
| |
| <dl><dt><a name="StorySet-RemoveStory"><strong>RemoveStory</strong></a>(self, story)</dt><dd><tt>Removes a Story.<br> |
| <br> |
| Allows the stories to be filtered.</tt></dd></dl> |
| |
| <dl><dt><a name="StorySet-WprFilePathForStory"><strong>WprFilePathForStory</strong></a>(self, story)</dt><dd><tt>Convenient function to retrieve WPR archive file path.<br> |
| <br> |
| Args:<br> |
| story: The Story to look up.<br> |
| <br> |
| Returns:<br> |
| The WPR archive file path for the given Story, if found.<br> |
| Otherwise, None.</tt></dd></dl> |
| |
| <dl><dt><a name="StorySet-__getitem__"><strong>__getitem__</strong></a>(self, key)</dt></dl> |
| |
| <dl><dt><a name="StorySet-__init__"><strong>__init__</strong></a>(self, archive_data_file<font color="#909090">=''</font>, cloud_storage_bucket<font color="#909090">=None</font>, base_dir<font color="#909090">=None</font>, serving_dirs<font color="#909090">=None</font>)</dt><dd><tt>Creates a new <a href="#StorySet">StorySet</a>.<br> |
| <br> |
| Args:<br> |
| archive_data_file: The path to Web Page Replay's archive data, relative<br> |
| to self.<strong>base_dir</strong>.<br> |
| cloud_storage_bucket: The cloud storage bucket used to download<br> |
| Web Page Replay's archive data. Valid values are: None,<br> |
| story.PUBLIC_BUCKET, story.PARTNER_BUCKET, or story.INTERNAL_BUCKET<br> |
| (defined in telemetry.util.cloud_storage).<br> |
| serving_dirs: A set of paths, relative to self.<strong>base_dir</strong>, to directories<br> |
| containing hash files for non-wpr archive data stored in cloud<br> |
| storage.</tt></dd></dl> |
| |
| <dl><dt><a name="StorySet-__iter__"><strong>__iter__</strong></a>(self)</dt></dl> |
| |
| <dl><dt><a name="StorySet-__len__"><strong>__len__</strong></a>(self)</dt></dl> |
| |
| <dl><dt><a name="StorySet-__setitem__"><strong>__setitem__</strong></a>(self, key, value)</dt></dl> |
| |
| <hr> |
| Class methods defined here:<br> |
| <dl><dt><a name="StorySet-Description"><strong>Description</strong></a>(cls)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Return a string explaining in human-understandable terms what this<br> |
| story represents.<br> |
| Note that this should be a classmethod so the benchmark_runner script can<br> |
| display stories' names along with their descriptions in the list command.</tt></dd></dl> |
| |
| <dl><dt><a name="StorySet-Name"><strong>Name</strong></a>(cls)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Returns the string name of this <a href="#StorySet">StorySet</a>.<br> |
| Note that this should be a classmethod so the benchmark_runner script can<br> |
| match the story class with its name specified in the run command:<br> |
| 'Run <User story test name> <User story class name>'</tt></dd></dl> |
| |
| <hr> |
| Data descriptors defined here:<br> |
| <dl><dt><strong>__dict__</strong></dt> |
| <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| </dl> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| </dl> |
| <dl><dt><strong>allow_mixed_story_states</strong></dt> |
| <dd><tt>True iff Stories are allowed to have different StoryState classes.<br> |
| <br> |
| There are no checks in place for determining if SharedStates are<br> |
| being assigned correctly to all Stories in a given StorySet. The<br> |
| majority of test cases should not need the ability to have multiple<br> |
| SharedStates, which usually implies you should be writing multiple<br> |
| benchmarks instead. We provide errors to avoid accidentally assigning<br> |
| or defaulting to the wrong SharedState.<br> |
| Override at your own risk. Here be dragons.</tt></dd> |
| </dl> |
| <dl><dt><strong>archive_data_file</strong></dt> |
| </dl> |
| <dl><dt><strong>base_dir</strong></dt> |
| <dd><tt>The base directory to resolve archive_data_file.<br> |
| <br> |
| This defaults to the directory containing the StorySet instance's class.</tt></dd> |
| </dl> |
| <dl><dt><strong>bucket</strong></dt> |
| </dl> |
| <dl><dt><strong>file_path</strong></dt> |
| </dl> |
| <dl><dt><strong>serving_dirs</strong></dt> |
| </dl> |
| <dl><dt><strong>wpr_archive_info</strong></dt> |
| <dd><tt>Lazily constructs wpr_archive_info if it's not set and returns it.</tt></dd> |
| </dl> |
| </td></tr></table></td></tr></table> |
| </body></html> |