1 2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 3<html><head><title>Python: module telemetry.story.story_set</title> 4<meta charset="utf-8"> 5</head><body bgcolor="#f0f0f8"> 6 7<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> 8<tr bgcolor="#7799ee"> 9<td valign=bottom> <br> 10<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 11><td align=right valign=bottom 12><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> 13 <p><tt># Copyright 2014 The Chromium Authors. All rights reserved.<br> 14# Use of this source code is governed by a BSD-style license that can be<br> 15# found in the LICENSE file.</tt></p> 16<p> 17<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 18<tr bgcolor="#aa55cc"> 19<td colspan=3 valign=bottom> <br> 20<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> 21 22<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> 23<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> 24</td><td width="25%" valign=top><a href="inspect.html">inspect</a><br> 25</td><td width="25%" valign=top><a href="os.html">os</a><br> 26</td><td width="25%" valign=top><a href="telemetry.story.story.html">telemetry.story.story</a><br> 27</td></tr></table></td></tr></table><p> 28<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 29<tr bgcolor="#ee77aa"> 30<td colspan=3 valign=bottom> <br> 31<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> 32 33<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> 34<td width="100%"><dl> 35<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> 36</font></dt><dd> 37<dl> 38<dt><font face="helvetica, arial"><a href="telemetry.story.story_set.html#StorySet">StorySet</a> 39</font></dt></dl> 40</dd> 41</dl> 42 <p> 43<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 44<tr bgcolor="#ffc8d8"> 45<td colspan=3 valign=bottom> <br> 46<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> 47 48<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 49<td colspan=2><tt>A collection of stories.<br> 50 <br> 51A typical usage of <a href="#StorySet">StorySet</a> would be to subclass it and then call<br> 52AddStory for each Story.<br> </tt></td></tr> 53<tr><td> </td> 54<td width="100%">Methods defined here:<br> 55<dl><dt><a name="StorySet-AddStory"><strong>AddStory</strong></a>(self, story)</dt></dl> 56 57<dl><dt><a name="StorySet-RemoveStory"><strong>RemoveStory</strong></a>(self, story)</dt><dd><tt>Removes a Story.<br> 58 <br> 59Allows the stories to be filtered.</tt></dd></dl> 60 61<dl><dt><a name="StorySet-WprFilePathForStory"><strong>WprFilePathForStory</strong></a>(self, story)</dt><dd><tt>Convenient function to retrieve WPR archive file path.<br> 62 <br> 63Args:<br> 64 story: The Story to look up.<br> 65 <br> 66Returns:<br> 67 The WPR archive file path for the given Story, if found.<br> 68 Otherwise, None.</tt></dd></dl> 69 70<dl><dt><a name="StorySet-__getitem__"><strong>__getitem__</strong></a>(self, key)</dt></dl> 71 72<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> 73 <br> 74Args:<br> 75 archive_data_file: The path to Web Page Replay's archive data, relative<br> 76 to self.<strong>base_dir</strong>.<br> 77 cloud_storage_bucket: The cloud storage bucket used to download<br> 78 Web Page Replay's archive data. Valid values are: None,<br> 79 story.PUBLIC_BUCKET, story.PARTNER_BUCKET, or story.INTERNAL_BUCKET<br> 80 (defined in telemetry.util.cloud_storage).<br> 81 serving_dirs: A set of paths, relative to self.<strong>base_dir</strong>, to directories<br> 82 containing hash files for non-wpr archive data stored in cloud<br> 83 storage.</tt></dd></dl> 84 85<dl><dt><a name="StorySet-__iter__"><strong>__iter__</strong></a>(self)</dt></dl> 86 87<dl><dt><a name="StorySet-__len__"><strong>__len__</strong></a>(self)</dt></dl> 88 89<dl><dt><a name="StorySet-__setitem__"><strong>__setitem__</strong></a>(self, key, value)</dt></dl> 90 91<hr> 92Class methods defined here:<br> 93<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> 94story represents.<br> 95Note that this should be a classmethod so the benchmark_runner script can<br> 96display stories' names along with their descriptions in the list command.</tt></dd></dl> 97 98<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> 99Note that this should be a classmethod so the benchmark_runner script can<br> 100match the story class with its name specified in the run command:<br> 101'Run <User story test name> <User story class name>'</tt></dd></dl> 102 103<hr> 104Data descriptors defined here:<br> 105<dl><dt><strong>__dict__</strong></dt> 106<dd><tt>dictionary for instance variables (if defined)</tt></dd> 107</dl> 108<dl><dt><strong>__weakref__</strong></dt> 109<dd><tt>list of weak references to the object (if defined)</tt></dd> 110</dl> 111<dl><dt><strong>allow_mixed_story_states</strong></dt> 112<dd><tt>True iff Stories are allowed to have different StoryState classes.<br> 113 <br> 114There are no checks in place for determining if SharedStates are<br> 115being assigned correctly to all Stories in a given StorySet. The<br> 116majority of test cases should not need the ability to have multiple<br> 117SharedStates, which usually implies you should be writing multiple<br> 118benchmarks instead. We provide errors to avoid accidentally assigning<br> 119or defaulting to the wrong SharedState.<br> 120Override at your own risk. Here be dragons.</tt></dd> 121</dl> 122<dl><dt><strong>archive_data_file</strong></dt> 123</dl> 124<dl><dt><strong>base_dir</strong></dt> 125<dd><tt>The base directory to resolve archive_data_file.<br> 126 <br> 127This defaults to the directory containing the StorySet instance's class.</tt></dd> 128</dl> 129<dl><dt><strong>bucket</strong></dt> 130</dl> 131<dl><dt><strong>file_path</strong></dt> 132</dl> 133<dl><dt><strong>serving_dirs</strong></dt> 134</dl> 135<dl><dt><strong>wpr_archive_info</strong></dt> 136<dd><tt>Lazily constructs wpr_archive_info if it's not set and returns it.</tt></dd> 137</dl> 138</td></tr></table></td></tr></table> 139</body></html>