stella 0.3.2 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. data/README.txt +24 -84
  2. data/Rakefile +1 -6
  3. data/doc/classes/Crypto.html +248 -0
  4. data/doc/classes/Crypto/Key.html +308 -0
  5. data/doc/classes/Enumerable.html +309 -0
  6. data/doc/classes/FileUtil.html +310 -0
  7. data/doc/classes/HTTPUtil.html +530 -0
  8. data/doc/classes/MathUtil.html +210 -0
  9. data/doc/classes/Stella.html +238 -0
  10. data/doc/classes/Stella/Adapter.html +127 -0
  11. data/doc/classes/Stella/Adapter/ApacheBench.html +1076 -0
  12. data/doc/classes/Stella/Adapter/Base.html +432 -0
  13. data/doc/classes/Stella/Adapter/CommandNotReady.html +146 -0
  14. data/doc/classes/Stella/Adapter/Httperf.html +949 -0
  15. data/doc/classes/Stella/Adapter/Siege.html +1011 -0
  16. data/doc/classes/Stella/CLI.html +914 -0
  17. data/doc/classes/Stella/CLI/Base.html +186 -0
  18. data/doc/classes/Stella/CLI/Language.html +149 -0
  19. data/doc/classes/Stella/CLI/LocalTest.html +268 -0
  20. data/doc/classes/Stella/Command.html +111 -0
  21. data/doc/classes/Stella/Command/Base.html +335 -0
  22. data/doc/classes/Stella/Config.html +292 -0
  23. data/doc/classes/Stella/InvalidArgument.html +242 -0
  24. data/doc/classes/Stella/LocalTest.html +450 -0
  25. data/doc/classes/Stella/Logger.html +548 -0
  26. data/doc/classes/Stella/Response.html +846 -0
  27. data/doc/classes/Stella/Storable.html +928 -0
  28. data/doc/classes/Stella/Test.html +142 -0
  29. data/doc/classes/Stella/Test/DaySummary.html +249 -0
  30. data/doc/classes/Stella/Test/Definition.html +294 -0
  31. data/doc/classes/Stella/Test/Definition/Rampup.html +215 -0
  32. data/doc/classes/Stella/Test/RunSummary.html +315 -0
  33. data/doc/classes/Stella/Test/SummaryBase.html +286 -0
  34. data/doc/classes/Stella/Test/TestSummary.html +200 -0
  35. data/doc/classes/Stella/Text.html +581 -0
  36. data/doc/classes/Stella/Text/Resource.html +289 -0
  37. data/doc/classes/Stella/UnavailableAdapter.html +242 -0
  38. data/doc/classes/Stella/UnknownValue.html +242 -0
  39. data/doc/classes/Stella/UnsupportedLanguage.html +115 -0
  40. data/doc/classes/Stella/Util.html +348 -0
  41. data/doc/classes/TextGraph.html +460 -0
  42. data/doc/classes/TimerUtil.html +431 -0
  43. data/doc/created.rid +1 -0
  44. data/doc/files/LICENSE_txt.html +129 -0
  45. data/doc/files/README_txt.html +209 -0
  46. data/doc/files/lib/stella/adapter/ab_rb.html +101 -0
  47. data/doc/files/lib/stella/adapter/base_rb.html +101 -0
  48. data/doc/files/lib/stella/adapter/httperf_rb.html +101 -0
  49. data/doc/files/lib/stella/adapter/siege_rb.html +101 -0
  50. data/doc/files/lib/stella/cli/base_rb.html +101 -0
  51. data/doc/files/lib/stella/cli/language_rb.html +101 -0
  52. data/doc/files/lib/stella/cli/localtest_rb.html +101 -0
  53. data/doc/files/lib/stella/cli_rb.html +112 -0
  54. data/doc/files/lib/stella/command/base_rb.html +101 -0
  55. data/doc/files/lib/stella/command/localtest_rb.html +101 -0
  56. data/doc/files/lib/stella/logger_rb.html +101 -0
  57. data/doc/files/lib/stella/response_rb.html +101 -0
  58. data/doc/files/lib/stella/storable_rb.html +109 -0
  59. data/doc/files/lib/stella/support_rb.html +101 -0
  60. data/doc/files/lib/stella/test/daysummary_rb.html +101 -0
  61. data/doc/files/lib/stella/test/definition_rb.html +101 -0
  62. data/doc/files/lib/stella/test/runsummary_rb.html +101 -0
  63. data/doc/files/lib/stella/test/summarybase_rb.html +101 -0
  64. data/doc/files/lib/stella/test/testsummary_rb.html +108 -0
  65. data/doc/files/lib/stella/text/resource_rb.html +108 -0
  66. data/doc/files/lib/stella/text_rb.html +108 -0
  67. data/doc/files/lib/stella_rb.html +128 -0
  68. data/doc/files/lib/utils/crypto-key_rb.html +116 -0
  69. data/doc/files/lib/utils/fileutil_rb.html +108 -0
  70. data/doc/files/lib/utils/httputil_rb.html +110 -0
  71. data/doc/files/lib/utils/mathutil_rb.html +101 -0
  72. data/doc/files/lib/utils/textgraph_rb.html +138 -0
  73. data/doc/files/lib/utils/timerutil_rb.html +108 -0
  74. data/doc/fr_class_index.html +66 -0
  75. data/doc/fr_file_index.html +62 -0
  76. data/doc/fr_method_index.html +309 -0
  77. data/doc/index.html +24 -0
  78. data/doc/rdoc-style.css +208 -0
  79. data/lib/stella.rb +5 -6
  80. data/lib/stella/adapter/ab.rb +4 -31
  81. data/lib/stella/adapter/base.rb +1 -15
  82. data/lib/stella/adapter/httperf.rb +4 -35
  83. data/lib/stella/adapter/siege.rb +29 -51
  84. data/lib/stella/cli.rb +22 -45
  85. data/lib/stella/cli/language.rb +0 -2
  86. data/lib/stella/cli/localtest.rb +0 -5
  87. data/lib/stella/command/base.rb +1 -1
  88. data/lib/stella/command/localtest.rb +68 -84
  89. data/lib/stella/test/daysummary.rb +93 -0
  90. data/lib/stella/test/definition.rb +5 -10
  91. data/lib/stella/test/{run/summary.rb → runsummary.rb} +6 -4
  92. data/lib/stella/test/{base.rb → summarybase.rb} +7 -3
  93. data/lib/stella/test/{summary.rb → testsummary.rb} +29 -27
  94. data/lib/utils/mathutil.rb +34 -36
  95. data/spec/base.rb +26 -0
  96. data/spec/shell_spec.rb +12 -0
  97. data/support/text/en.yaml +1 -7
  98. metadata +102 -8
  99. data/lib/stella/cli/agents.rb +0 -73
  100. data/lib/utils/escape.rb +0 -302
@@ -0,0 +1,242 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: Stella::InvalidArgument</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">Stella::InvalidArgument</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/stella/support_rb.html">
59
+ lib/stella/support.rb
60
+ </a>
61
+ <br />
62
+ <a href="../../files/lib/stella/support_rb.html">
63
+ lib/stella/support.rb
64
+ </a>
65
+ <br />
66
+ </td>
67
+ </tr>
68
+
69
+ <tr class="top-aligned-row">
70
+ <td><strong>Parent:</strong></td>
71
+ <td>
72
+ RuntimeError
73
+ </td>
74
+ </tr>
75
+ </table>
76
+ </div>
77
+ <!-- banner header -->
78
+
79
+ <div id="bodyContent">
80
+
81
+
82
+
83
+ <div id="contextContent">
84
+
85
+
86
+
87
+ </div>
88
+
89
+ <div id="method-list">
90
+ <h3 class="section-bar">Methods</h3>
91
+
92
+ <div class="name-list">
93
+ <a href="#M000197">message</a>&nbsp;&nbsp;
94
+ <a href="#M000195">message</a>&nbsp;&nbsp;
95
+ <a href="#M000196">new</a>&nbsp;&nbsp;
96
+ <a href="#M000194">new</a>&nbsp;&nbsp;
97
+ </div>
98
+ </div>
99
+
100
+ </div>
101
+
102
+
103
+ <!-- if includes -->
104
+
105
+ <div id="section">
106
+
107
+
108
+
109
+
110
+
111
+ <div id="attribute-list">
112
+ <h3 class="section-bar">Attributes</h3>
113
+
114
+ <div class="name-list">
115
+ <table>
116
+ <tr class="top-aligned-row context-row">
117
+ <td class="context-item-name">name</td>
118
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
119
+ <td class="context-item-desc"></td>
120
+ </tr>
121
+ <tr class="top-aligned-row context-row">
122
+ <td class="context-item-name">name</td>
123
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
124
+ <td class="context-item-desc"></td>
125
+ </tr>
126
+ </table>
127
+ </div>
128
+ </div>
129
+
130
+
131
+
132
+ <!-- if method_list -->
133
+ <div id="methods">
134
+ <h3 class="section-bar">Public Class methods</h3>
135
+
136
+ <div id="method-M000196" class="method-detail">
137
+ <a name="M000196"></a>
138
+
139
+ <div class="method-heading">
140
+ <a href="#M000196" class="method-signature">
141
+ <span class="method-name">new</span><span class="method-args">(name)</span>
142
+ </a>
143
+ </div>
144
+
145
+ <div class="method-description">
146
+ <p><a class="source-toggle" href="#"
147
+ onclick="toggleCode('M000196-source');return false;">[Source]</a></p>
148
+ <div class="method-source-code" id="M000196-source">
149
+ <pre>
150
+ <span class="ruby-comment cmt"># File lib/stella/support.rb, line 8</span>
151
+ 8: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">name</span>)
152
+ 9: <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">name</span>
153
+ 10: <span class="ruby-keyword kw">end</span>
154
+ </pre>
155
+ </div>
156
+ </div>
157
+ </div>
158
+
159
+ <div id="method-M000194" class="method-detail">
160
+ <a name="M000194"></a>
161
+
162
+ <div class="method-heading">
163
+ <a href="#M000194" class="method-signature">
164
+ <span class="method-name">new</span><span class="method-args">(name)</span>
165
+ </a>
166
+ </div>
167
+
168
+ <div class="method-description">
169
+ <p><a class="source-toggle" href="#"
170
+ onclick="toggleCode('M000194-source');return false;">[Source]</a></p>
171
+ <div class="method-source-code" id="M000194-source">
172
+ <pre>
173
+ <span class="ruby-comment cmt"># File lib/stella/support.rb, line 8</span>
174
+ 8: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">name</span>)
175
+ 9: <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">name</span>
176
+ 10: <span class="ruby-keyword kw">end</span>
177
+ </pre>
178
+ </div>
179
+ </div>
180
+ </div>
181
+
182
+ <h3 class="section-bar">Public Instance methods</h3>
183
+
184
+ <div id="method-M000197" class="method-detail">
185
+ <a name="M000197"></a>
186
+
187
+ <div class="method-heading">
188
+ <a href="#M000197" class="method-signature">
189
+ <span class="method-name">message</span><span class="method-args">()</span>
190
+ </a>
191
+ </div>
192
+
193
+ <div class="method-description">
194
+ <p><a class="source-toggle" href="#"
195
+ onclick="toggleCode('M000197-source');return false;">[Source]</a></p>
196
+ <div class="method-source-code" id="M000197-source">
197
+ <pre>
198
+ <span class="ruby-comment cmt"># File lib/stella/support.rb, line 11</span>
199
+ 11: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">message</span>
200
+ 12: <span class="ruby-constant">Stella</span><span class="ruby-operator">::</span><span class="ruby-constant">TEXT</span>.<span class="ruby-identifier">err</span>(<span class="ruby-identifier">:error_invalid_argument</span>, <span class="ruby-ivar">@name</span>)
201
+ 13: <span class="ruby-keyword kw">end</span>
202
+ </pre>
203
+ </div>
204
+ </div>
205
+ </div>
206
+
207
+ <div id="method-M000195" class="method-detail">
208
+ <a name="M000195"></a>
209
+
210
+ <div class="method-heading">
211
+ <a href="#M000195" class="method-signature">
212
+ <span class="method-name">message</span><span class="method-args">()</span>
213
+ </a>
214
+ </div>
215
+
216
+ <div class="method-description">
217
+ <p><a class="source-toggle" href="#"
218
+ onclick="toggleCode('M000195-source');return false;">[Source]</a></p>
219
+ <div class="method-source-code" id="M000195-source">
220
+ <pre>
221
+ <span class="ruby-comment cmt"># File lib/stella/support.rb, line 11</span>
222
+ 11: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">message</span>
223
+ 12: <span class="ruby-constant">Stella</span><span class="ruby-operator">::</span><span class="ruby-constant">TEXT</span>.<span class="ruby-identifier">err</span>(<span class="ruby-identifier">:error_invalid_argument</span>, <span class="ruby-ivar">@name</span>)
224
+ 13: <span class="ruby-keyword kw">end</span>
225
+ </pre>
226
+ </div>
227
+ </div>
228
+ </div>
229
+
230
+
231
+ </div>
232
+
233
+
234
+ </div>
235
+
236
+
237
+ <div id="validator-badges">
238
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
239
+ </div>
240
+
241
+ </body>
242
+ </html>
@@ -0,0 +1,450 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: Stella::LocalTest</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">Stella::LocalTest</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/stella/command/localtest_rb.html">
59
+ lib/stella/command/localtest.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ <a href="Command/Base.html">
69
+ Stella::Command::Base
70
+ </a>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ <!-- banner header -->
76
+
77
+ <div id="bodyContent">
78
+
79
+
80
+
81
+ <div id="contextContent">
82
+
83
+
84
+
85
+ </div>
86
+
87
+ <div id="method-list">
88
+ <h3 class="section-bar">Methods</h3>
89
+
90
+ <div class="name-list">
91
+ <a href="#M000119">index_available_agents</a>&nbsp;&nbsp;
92
+ <a href="#M000122">latest_test_symlink_path</a>&nbsp;&nbsp;
93
+ <a href="#M000118">new</a>&nbsp;&nbsp;
94
+ <a href="#M000121">run</a>&nbsp;&nbsp;
95
+ <a href="#M000120">translate_requested_agents</a>&nbsp;&nbsp;
96
+ </div>
97
+ </div>
98
+
99
+ </div>
100
+
101
+
102
+ <!-- if includes -->
103
+
104
+ <div id="section">
105
+
106
+
107
+
108
+
109
+
110
+ <div id="attribute-list">
111
+ <h3 class="section-bar">Attributes</h3>
112
+
113
+ <div class="name-list">
114
+ <table>
115
+ <tr class="top-aligned-row context-row">
116
+ <td class="context-item-name">adapter</td>
117
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
118
+ <td class="context-item-desc">
119
+ The load tool adapter
120
+
121
+ </td>
122
+ </tr>
123
+ <tr class="top-aligned-row context-row">
124
+ <td class="context-item-name">all_runpaths</td>
125
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
126
+ <td class="context-item-desc">
127
+ same as above, expect for all tests
128
+
129
+ </td>
130
+ </tr>
131
+ <tr class="top-aligned-row context-row">
132
+ <td class="context-item-name">format</td>
133
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
134
+ <td class="context-item-desc"></td>
135
+ </tr>
136
+ <tr class="top-aligned-row context-row">
137
+ <td class="context-item-name">guid</td>
138
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
139
+ <td class="context-item-desc"></td>
140
+ </tr>
141
+ <tr class="top-aligned-row context-row">
142
+ <td class="context-item-name">hosts</td>
143
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
144
+ <td class="context-item-desc">
145
+ list of all hostname:port in the test
146
+
147
+ </td>
148
+ </tr>
149
+ <tr class="top-aligned-row context-row">
150
+ <td class="context-item-name">paths</td>
151
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
152
+ <td class="context-item-desc">
153
+ list of all /paths in the test
154
+
155
+ </td>
156
+ </tr>
157
+ <tr class="top-aligned-row context-row">
158
+ <td class="context-item-name">quiet</td>
159
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
160
+ <td class="context-item-desc"></td>
161
+ </tr>
162
+ <tr class="top-aligned-row context-row">
163
+ <td class="context-item-name">test_path</td>
164
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
165
+ <td class="context-item-desc"></td>
166
+ </tr>
167
+ <tr class="top-aligned-row context-row">
168
+ <td class="context-item-name">test_runpaths</td>
169
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
170
+ <td class="context-item-desc">
171
+ list of all filesystem paths for each <a
172
+ href="LocalTest.html#M000121">run</a> in a single test
173
+
174
+ </td>
175
+ </tr>
176
+ <tr class="top-aligned-row context-row">
177
+ <td class="context-item-name">testdef</td>
178
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
179
+ <td class="context-item-desc">
180
+ A container for the test parameters
181
+
182
+ </td>
183
+ </tr>
184
+ <tr class="top-aligned-row context-row">
185
+ <td class="context-item-name">verbose</td>
186
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
187
+ <td class="context-item-desc"></td>
188
+ </tr>
189
+ <tr class="top-aligned-row context-row">
190
+ <td class="context-item-name">working_directory</td>
191
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
192
+ <td class="context-item-desc"></td>
193
+ </tr>
194
+ </table>
195
+ </div>
196
+ </div>
197
+
198
+
199
+
200
+ <!-- if method_list -->
201
+ <div id="methods">
202
+ <h3 class="section-bar">Public Class methods</h3>
203
+
204
+ <div id="method-M000118" class="method-detail">
205
+ <a name="M000118"></a>
206
+
207
+ <div class="method-heading">
208
+ <a href="#M000118" class="method-signature">
209
+ <span class="method-name">new</span><span class="method-args">(testdef=nil, adapter=nil)</span>
210
+ </a>
211
+ </div>
212
+
213
+ <div class="method-description">
214
+ <p><a class="source-toggle" href="#"
215
+ onclick="toggleCode('M000118-source');return false;">[Source]</a></p>
216
+ <div class="method-source-code" id="M000118-source">
217
+ <pre>
218
+ <span class="ruby-comment cmt"># File lib/stella/command/localtest.rb, line 31</span>
219
+ 31: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">testdef</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">adapter</span>=<span class="ruby-keyword kw">nil</span>)
220
+ 32: <span class="ruby-ivar">@testdef</span> = <span class="ruby-identifier">testdef</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">testdef</span>
221
+ 33: <span class="ruby-ivar">@adapter</span> = <span class="ruby-identifier">adapter</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">adapter</span>
222
+ 34:
223
+ 35: <span class="ruby-ivar">@guid</span> = <span class="ruby-constant">Crypto</span>.<span class="ruby-identifier">sign</span>(<span class="ruby-identifier">rand</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">rand</span>.<span class="ruby-identifier">to_s</span>)
224
+ 36:
225
+ 37: <span class="ruby-ivar">@test_runpaths</span> = []
226
+ 38: <span class="ruby-ivar">@all_runpaths</span> = []
227
+ 39: <span class="ruby-ivar">@hosts</span> = []
228
+ 40: <span class="ruby-ivar">@paths</span> = []
229
+ 41: <span class="ruby-ivar">@format</span> = <span class="ruby-value str">'yaml'</span>
230
+ 42: <span class="ruby-ivar">@agents</span> = []
231
+ 43:
232
+ 44: <span class="ruby-ivar">@available_agents</span> = <span class="ruby-identifier">index_available_agents</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">STELLA_HOME</span>, <span class="ruby-value str">'support'</span>, <span class="ruby-value str">'useragents.txt'</span>))
233
+ 45: <span class="ruby-keyword kw">end</span>
234
+ </pre>
235
+ </div>
236
+ </div>
237
+ </div>
238
+
239
+ <h3 class="section-bar">Public Instance methods</h3>
240
+
241
+ <div id="method-M000119" class="method-detail">
242
+ <a name="M000119"></a>
243
+
244
+ <div class="method-heading">
245
+ <a href="#M000119" class="method-signature">
246
+ <span class="method-name">index_available_agents</span><span class="method-args">(path)</span>
247
+ </a>
248
+ </div>
249
+
250
+ <div class="method-description">
251
+ <p><a class="source-toggle" href="#"
252
+ onclick="toggleCode('M000119-source');return false;">[Source]</a></p>
253
+ <div class="method-source-code" id="M000119-source">
254
+ <pre>
255
+ <span class="ruby-comment cmt"># File lib/stella/command/localtest.rb, line 47</span>
256
+ 47: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">index_available_agents</span>(<span class="ruby-identifier">path</span>)
257
+ 48: <span class="ruby-constant">Stella</span><span class="ruby-operator">::</span><span class="ruby-constant">LOGGER</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;LOADING #{path}&quot;</span>)
258
+ 49: <span class="ruby-keyword kw">return</span> [] <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">path</span>)
259
+ 50: <span class="ruby-constant">Stella</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">process_useragents</span>(<span class="ruby-constant">FileUtil</span>.<span class="ruby-identifier">read_file_to_array</span>(<span class="ruby-identifier">path</span>))
260
+ 51: <span class="ruby-keyword kw">end</span>
261
+ </pre>
262
+ </div>
263
+ </div>
264
+ </div>
265
+
266
+ <div id="method-M000122" class="method-detail">
267
+ <a name="M000122"></a>
268
+
269
+ <div class="method-heading">
270
+ <a href="#M000122" class="method-signature">
271
+ <span class="method-name">latest_test_symlink_path</span><span class="method-args">()</span>
272
+ </a>
273
+ </div>
274
+
275
+ <div class="method-description">
276
+ <p><a class="source-toggle" href="#"
277
+ onclick="toggleCode('M000122-source');return false;">[Source]</a></p>
278
+ <div class="method-source-code" id="M000122-source">
279
+ <pre>
280
+ <span class="ruby-comment cmt"># File lib/stella/command/localtest.rb, line 163</span>
281
+ 163: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">latest_test_symlink_path</span>
282
+ 164: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@working_directory</span>
283
+ 165: <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@working_directory</span>, <span class="ruby-value str">'latest'</span>)
284
+ 166: <span class="ruby-keyword kw">end</span>
285
+ </pre>
286
+ </div>
287
+ </div>
288
+ </div>
289
+
290
+ <div id="method-M000121" class="method-detail">
291
+ <a name="M000121"></a>
292
+
293
+ <div class="method-heading">
294
+ <a href="#M000121" class="method-signature">
295
+ <span class="method-name">run</span><span class="method-args">()</span>
296
+ </a>
297
+ </div>
298
+
299
+ <div class="method-description">
300
+ <p><a class="source-toggle" href="#"
301
+ onclick="toggleCode('M000121-source');return false;">[Source]</a></p>
302
+ <div class="method-source-code" id="M000121-source">
303
+ <pre>
304
+ <span class="ruby-comment cmt"># File lib/stella/command/localtest.rb, line 61</span>
305
+ 61: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>
306
+ 62:
307
+ 63:
308
+ 64: <span class="ruby-identifier">raise</span> <span class="ruby-constant">UnavailableAdapter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@adapter</span>.<span class="ruby-identifier">name</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@adapter</span>.<span class="ruby-identifier">available?</span>
309
+ 65:
310
+ 66: <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@adapter</span>.<span class="ruby-identifier">loadtest?</span>
311
+ 67: <span class="ruby-identifier">system</span>(<span class="ruby-ivar">@adapter</span>.<span class="ruby-identifier">command</span>)
312
+ 68:
313
+ 69: <span class="ruby-keyword kw">return</span>
314
+ 70: <span class="ruby-keyword kw">end</span>
315
+ 71:
316
+ 72: <span class="ruby-ivar">@agents</span> = <span class="ruby-identifier">translate_requested_agents</span>(<span class="ruby-ivar">@testdef</span>.<span class="ruby-identifier">agents</span>)
317
+ 73:
318
+ 74: <span class="ruby-identifier">test_path</span> = <span class="ruby-identifier">_generate_test_path</span>
319
+ 75:
320
+ 76:
321
+ 77: <span class="ruby-identifier">prepare_test</span>(<span class="ruby-identifier">test_path</span>)
322
+ 78:
323
+ 79: <span class="ruby-identifier">threshold</span> = (<span class="ruby-ivar">@testdef</span>.<span class="ruby-identifier">rampup</span>) <span class="ruby-operator">?</span> <span class="ruby-ivar">@testdef</span>.<span class="ruby-identifier">rampup</span>.<span class="ruby-identifier">ceiling</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@adapter</span>.<span class="ruby-identifier">vusers</span>
324
+ 80:
325
+ 81:
326
+ 82: <span class="ruby-identifier">runnum</span> = <span class="ruby-value str">&quot;00&quot;</span>
327
+ 83: <span class="ruby-keyword kw">while</span>(<span class="ruby-ivar">@adapter</span>.<span class="ruby-identifier">vusers</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-identifier">threshold</span>) <span class="ruby-keyword kw">do</span>
328
+ 84:
329
+ 85: <span class="ruby-comment cmt"># Make sure the load factor is set to 1. If there was a warmup, </span>
330
+ 86: <span class="ruby-comment cmt"># then this value will be less than 1.</span>
331
+ 87: <span class="ruby-identifier">testrun</span> = <span class="ruby-identifier">testrun_maker</span>(<span class="ruby-value">1</span>)
332
+ 88:
333
+ 89: <span class="ruby-comment cmt"># We empty test_runpaths so we can keep track of the runpaths for each</span>
334
+ 90: <span class="ruby-comment cmt"># level of virtual users. This is useful during a rampup test so we can</span>
335
+ 91: <span class="ruby-comment cmt"># collect the stats for the repetitions at each virtual user level. </span>
336
+ 92: <span class="ruby-ivar">@test_runpaths</span> = []
337
+ 93:
338
+ 94: <span class="ruby-comment cmt"># Execute each test run in turn. All of the steps are the same for each</span>
339
+ 95: <span class="ruby-comment cmt"># run. This is important because the purpose of the test runs is to </span>
340
+ 96: <span class="ruby-comment cmt"># create a statistical certainty of performance. </span>
341
+ 97: <span class="ruby-ivar">@testdef</span>.<span class="ruby-identifier">repetitions</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span>
342
+ 98:
343
+ 99: <span class="ruby-comment cmt"># This value is used to create the run directory and show which run we're on</span>
344
+ 100: <span class="ruby-identifier">runnum</span>.<span class="ruby-identifier">succ!</span>
345
+ 101:
346
+ 102: <span class="ruby-comment cmt"># Generate the filesystem path to store the run data.</span>
347
+ 103: <span class="ruby-identifier">runpath</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">test_path</span>, <span class="ruby-node">&quot;run#{runnum}&quot;</span>)
348
+ 104:
349
+ 105: <span class="ruby-comment cmt"># Keep track of every run path. We use this in postpare to </span>
350
+ 106: <span class="ruby-comment cmt"># do some stuff after all the tests have run</span>
351
+ 107: <span class="ruby-ivar">@all_runpaths</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">runpath</span>
352
+ 108:
353
+ 109: <span class="ruby-comment cmt"># test_runpaths will be identical to all_runpaths except when there is a</span>
354
+ 110: <span class="ruby-comment cmt"># rampup. In that case, test_runpaths will contain the runpaths for all</span>
355
+ 111: <span class="ruby-comment cmt"># repetitions of each level of virtual users. </span>
356
+ 112: <span class="ruby-ivar">@test_runpaths</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">runpath</span>
357
+ 113:
358
+ 114: <span class="ruby-identifier">testrun</span>.<span class="ruby-identifier">call</span>(<span class="ruby-node">&quot;Run #{runnum}&quot;</span>, <span class="ruby-identifier">runpath</span>)
359
+ 115:
360
+ 116: <span class="ruby-comment cmt"># Only sleep if requested and there is more than 1 test run</span>
361
+ 117: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@testdef</span>.<span class="ruby-identifier">sleep</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@testdef</span>.<span class="ruby-identifier">sleep</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@testdef</span>.<span class="ruby-identifier">repetitions</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
362
+ 118: <span class="ruby-identifier">run_sleeper</span>(<span class="ruby-ivar">@testdef</span>.<span class="ruby-identifier">sleep</span>)
363
+ 119: <span class="ruby-keyword kw">end</span>
364
+ 120: <span class="ruby-constant">Stella</span><span class="ruby-operator">::</span><span class="ruby-constant">LOGGER</span>.<span class="ruby-identifier">info</span>(<span class="ruby-value str">''</span>) <span class="ruby-comment cmt"># We want the newline</span>
365
+ 121: <span class="ruby-keyword kw">end</span>
366
+ 122:
367
+ 123: <span class="ruby-comment cmt"># Rampup tests produce multiple summary files which include the batch</span>
368
+ 124: <span class="ruby-comment cmt"># number. Regular runs have just one file we set here as the default. </span>
369
+ 125: <span class="ruby-identifier">summary_name</span> = <span class="ruby-value str">&quot;SUMMARY&quot;</span>
370
+ 126:
371
+ 127: <span class="ruby-comment cmt"># It's possible for the interval to not divide evenly into the ceiling</span>
372
+ 128: <span class="ruby-comment cmt"># If we have room between the current number of virtual users and the</span>
373
+ 129: <span class="ruby-comment cmt"># ceiling, we'll add the difference for the final test run. </span>
374
+ 130: <span class="ruby-keyword kw">if</span> (<span class="ruby-ivar">@testdef</span>.<span class="ruby-identifier">rampup</span>)
375
+ 131: <span class="ruby-identifier">final_total</span> = <span class="ruby-ivar">@adapter</span>.<span class="ruby-identifier">vusers</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@testdef</span>.<span class="ruby-identifier">rampup</span>.<span class="ruby-identifier">interval</span>
376
+ 132: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">final_total</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">threshold</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">threshold</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@adapter</span>.<span class="ruby-identifier">vusers</span>) <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
377
+ 133: <span class="ruby-ivar">@adapter</span>.<span class="ruby-identifier">vusers</span> <span class="ruby-operator">+=</span> (<span class="ruby-identifier">threshold</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@adapter</span>.<span class="ruby-identifier">vusers</span>)
378
+ 134: <span class="ruby-keyword kw">else</span>
379
+ 135: <span class="ruby-ivar">@adapter</span>.<span class="ruby-identifier">vusers</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@testdef</span>.<span class="ruby-identifier">rampup</span>.<span class="ruby-identifier">interval</span>
380
+ 136: <span class="ruby-keyword kw">end</span>
381
+ 137: <span class="ruby-identifier">padded_users</span> = <span class="ruby-ivar">@adapter</span>.<span class="ruby-identifier">vusers</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">rjust</span>(<span class="ruby-value">4</span>, <span class="ruby-value str">'0'</span>)
382
+ 138: <span class="ruby-identifier">summary_name</span> = <span class="ruby-node">&quot;SUMMARY-#{padded_users}&quot;</span>
383
+ 139: <span class="ruby-keyword kw">end</span>
384
+ 140:
385
+ 141: <span class="ruby-comment cmt"># Read the run summaries for this batch and produce totals, averages, </span>
386
+ 142: <span class="ruby-comment cmt"># and standard deviations.</span>
387
+ 143: <span class="ruby-identifier">test_stats</span> = <span class="ruby-identifier">process_test_stats</span>(<span class="ruby-ivar">@test_runpaths</span>)
388
+ 144: <span class="ruby-identifier">print_summary</span>(<span class="ruby-identifier">test_stats</span>) <span class="ruby-keyword kw">if</span> (<span class="ruby-ivar">@testdef</span>.<span class="ruby-identifier">repetitions</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>)
389
+ 145: <span class="ruby-identifier">save_summary</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">test_path</span>, <span class="ruby-node">&quot;#{summary_name}.#{@format}&quot;</span>), <span class="ruby-identifier">test_stats</span>)
390
+ 146:
391
+ 147:
392
+ 148: <span class="ruby-comment cmt"># Non-rampup tests only need to run through the loop once. </span>
393
+ 149: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> (<span class="ruby-ivar">@adapter</span>.<span class="ruby-identifier">vusers</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">threshold</span>)
394
+ 150:
395
+ 151: <span class="ruby-keyword kw">end</span>
396
+ 152:
397
+ 153: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@testdef</span>.<span class="ruby-identifier">rampup</span>
398
+ 154: <span class="ruby-comment cmt"># Notice the difference between these test stats and the ones above?</span>
399
+ 155: <span class="ruby-comment cmt"># These stats are based on the entire rampup test, across all levels</span>
400
+ 156: <span class="ruby-comment cmt"># of virtual users.</span>
401
+ 157: <span class="ruby-identifier">test_stats</span> = <span class="ruby-identifier">process_test_stats</span>(<span class="ruby-ivar">@all_runpaths</span>)
402
+ 158: <span class="ruby-identifier">save_summary</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">test_path</span>, <span class="ruby-node">&quot;SUMMARY-RAMPUP.#{@format}&quot;</span>), <span class="ruby-identifier">test_stats</span>)
403
+ 159: <span class="ruby-identifier">print_summary</span>(<span class="ruby-identifier">test_stats</span>) <span class="ruby-keyword kw">if</span> (<span class="ruby-ivar">@testdef</span>.<span class="ruby-identifier">repetitions</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>)
404
+ 160: <span class="ruby-keyword kw">end</span>
405
+ 161: <span class="ruby-keyword kw">end</span>
406
+ </pre>
407
+ </div>
408
+ </div>
409
+ </div>
410
+
411
+ <div id="method-M000120" class="method-detail">
412
+ <a name="M000120"></a>
413
+
414
+ <div class="method-heading">
415
+ <a href="#M000120" class="method-signature">
416
+ <span class="method-name">translate_requested_agents</span><span class="method-args">(possible_agents=[])</span>
417
+ </a>
418
+ </div>
419
+
420
+ <div class="method-description">
421
+ <p><a class="source-toggle" href="#"
422
+ onclick="toggleCode('M000120-source');return false;">[Source]</a></p>
423
+ <div class="method-source-code" id="M000120-source">
424
+ <pre>
425
+ <span class="ruby-comment cmt"># File lib/stella/command/localtest.rb, line 53</span>
426
+ 53: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">translate_requested_agents</span>(<span class="ruby-identifier">possible_agents</span>=[])
427
+ 54: <span class="ruby-identifier">agents</span> = []
428
+ 55: <span class="ruby-identifier">possible_agents</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
429
+ 56: <span class="ruby-identifier">agents</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">find_agent</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">a</span>)
430
+ 57: <span class="ruby-keyword kw">end</span>
431
+ 58: <span class="ruby-identifier">agents</span>
432
+ 59: <span class="ruby-keyword kw">end</span>
433
+ </pre>
434
+ </div>
435
+ </div>
436
+ </div>
437
+
438
+
439
+ </div>
440
+
441
+
442
+ </div>
443
+
444
+
445
+ <div id="validator-badges">
446
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
447
+ </div>
448
+
449
+ </body>
450
+ </html>