kb-simple-metrics 0.0.12-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/.gitignore +20 -0
  2. data/.rspec +2 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE +13 -0
  5. data/README.md +144 -0
  6. data/Rakefile +7 -0
  7. data/doc/NurseRatched.html +246 -0
  8. data/doc/Rdio.html +233 -0
  9. data/doc/Samovar.html +241 -0
  10. data/doc/Simple/Metrics/Check.html +308 -0
  11. data/doc/Simple/Metrics/Graphite.html +262 -0
  12. data/doc/Simple/Metrics/HEALTHY.html +144 -0
  13. data/doc/Simple/Metrics/Health.html +288 -0
  14. data/doc/Simple/Metrics/Healthchecks.html +413 -0
  15. data/doc/Simple/Metrics/Meter.html +295 -0
  16. data/doc/Simple/Metrics/RackMetrics.html +366 -0
  17. data/doc/Simple/Metrics/Timer.html +232 -0
  18. data/doc/Simple/Metrics/UNHEALTHY.html +144 -0
  19. data/doc/Simple/Metrics/WARNING.html +144 -0
  20. data/doc/Simple/Metrics.html +510 -0
  21. data/doc/Simple.html +117 -0
  22. data/doc/_index.html +259 -0
  23. data/doc/class_list.html +53 -0
  24. data/doc/css/common.css +1 -0
  25. data/doc/css/full_list.css +57 -0
  26. data/doc/css/style.css +328 -0
  27. data/doc/file.README.html +224 -0
  28. data/doc/file_list.html +55 -0
  29. data/doc/frames.html +28 -0
  30. data/doc/index.html +224 -0
  31. data/doc/js/app.js +214 -0
  32. data/doc/js/full_list.js +173 -0
  33. data/doc/js/jquery.js +4 -0
  34. data/doc/method_list.html +180 -0
  35. data/doc/top-level-namespace.html +114 -0
  36. data/lib/java/jackson-core-asl-1.9.5.jar +0 -0
  37. data/lib/java/jackson-mapper-asl-1.9.5.jar +0 -0
  38. data/lib/java/metrics-core-2.1.1.jar +0 -0
  39. data/lib/java/metrics-graphite-2.1.1.jar +0 -0
  40. data/lib/java/metrics-servlet-2.1.1.jar +0 -0
  41. data/lib/java/slf4j-api-1.6.4.jar +0 -0
  42. data/lib/simple/metrics/graphite.rb +23 -0
  43. data/lib/simple/metrics/health.rb +15 -0
  44. data/lib/simple/metrics/healthcheck.rb +65 -0
  45. data/lib/simple/metrics/meter.rb +23 -0
  46. data/lib/simple/metrics/rack_metrics.rb +32 -0
  47. data/lib/simple/metrics/timer.rb +24 -0
  48. data/lib/simple/metrics.rb +51 -0
  49. data/lib/simple/version.rb +5 -0
  50. data/lib/simple.rb +6 -0
  51. data/simple-metrics.gemspec +21 -0
  52. data/spec/metrics/graphite_spec.rb +9 -0
  53. data/spec/metrics/healthcheck_spec.rb +55 -0
  54. data/spec/metrics/meter_spec.rb +20 -0
  55. data/spec/metrics/timer_spec.rb +29 -0
  56. data/spec/spec_helper.rb +13 -0
  57. metadata +182 -0
@@ -0,0 +1,295 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Module: Simple::Metrics::Meter
8
+
9
+ &mdash; Documentation by YARD 0.8.3
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../../';
20
+ framesUrl = "../../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../../_index.html">Index (M)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../Simple.html" title="Simple (module)">Simple</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Metrics.html" title="Simple::Metrics (module)">Metrics</a></span></span>
36
+ &raquo;
37
+ <span class="title">Meter</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Module: Simple::Metrics::Meter
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+ <dt class="r1">Includes:</dt>
79
+ <dd class="r1"><span class='object_link'><a href="../Metrics.html" title="Simple::Metrics (module)">Simple::Metrics</a></span></dd>
80
+
81
+
82
+
83
+
84
+ <dt class="r2">Included in:</dt>
85
+ <dd class="r2"><span class='object_link'><a href="../../Rdio.html" title="Rdio (class)">Rdio</a></span>, <span class='object_link'><a href="RackMetrics.html" title="Simple::Metrics::RackMetrics (class)">RackMetrics</a></span></dd>
86
+
87
+
88
+
89
+ <dt class="r1 last">Defined in:</dt>
90
+ <dd class="r1 last">lib/simple/metrics/meter.rb</dd>
91
+
92
+ </dl>
93
+ <div class="clear"></div>
94
+
95
+
96
+ <h2>Constant Summary</h2>
97
+
98
+
99
+
100
+
101
+ <h2>Constant Summary</h2>
102
+
103
+ <h3 class="inherited">Constants included
104
+ from <span class='object_link'><a href="../Metrics.html" title="Simple::Metrics (module)">Simple::Metrics</a></span></h3>
105
+ <p class="inherited"><span class='object_link'><a href="../Metrics.html#DEFAULT_DURATION_UNIT-constant" title="Simple::Metrics::DEFAULT_DURATION_UNIT (constant)">DEFAULT_DURATION_UNIT</a></span>, <span class='object_link'><a href="../Metrics.html#DEFAULT_RATE_UNIT-constant" title="Simple::Metrics::DEFAULT_RATE_UNIT (constant)">DEFAULT_RATE_UNIT</a></span>, <span class='object_link'><a href="../Metrics.html#DEFAULT_TIMING_UNIT-constant" title="Simple::Metrics::DEFAULT_TIMING_UNIT (constant)">DEFAULT_TIMING_UNIT</a></span>, <span class='object_link'><a href="../Metrics.html#VERSION-constant" title="Simple::Metrics::VERSION (constant)">VERSION</a></span></p>
106
+
107
+
108
+
109
+
110
+
111
+
112
+ <h2>
113
+ Instance Method Summary
114
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
115
+ </h2>
116
+
117
+ <ul class="summary">
118
+
119
+ <li class="public ">
120
+ <span class="summary_signature">
121
+
122
+ <a href="#define_meter-instance_method" title="#define_meter (instance method)">- (Object) <strong>define_meter</strong>(name, klass_name = self.class.name, time_unit = Simple::Metrics::DEFAULT_RATE_UNIT) </a>
123
+
124
+
125
+
126
+ </span>
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+ <span class="summary_desc"><div class='inline'>
137
+ <p>Create a new meter.</p>
138
+ </div></span>
139
+
140
+ </li>
141
+
142
+
143
+ </ul>
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="../Metrics.html" title="Simple::Metrics (module)">Simple::Metrics</a></span></h3>
156
+ <p class="inherited"><span class='object_link'><a href="../Metrics.html#metrics_registry-instance_method" title="Simple::Metrics#metrics_registry (method)">#metrics_registry</a></span>, <span class='object_link'><a href="../Metrics.html#new_metric_name-instance_method" title="Simple::Metrics#new_metric_name (method)">#new_metric_name</a></span>, <span class='object_link'><a href="../Metrics.html#sanitize_classname-instance_method" title="Simple::Metrics#sanitize_classname (method)">#sanitize_classname</a></span></p>
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="Timer.html" title="Simple::Metrics::Timer (module)">Timer</a></span></h3>
167
+ <p class="inherited"><span class='object_link'><a href="Timer.html#timer-instance_method" title="Simple::Metrics::Timer#timer (method)">#timer</a></span></p>
168
+
169
+
170
+ <div id="instance_method_details" class="method_details_list">
171
+ <h2>Instance Method Details</h2>
172
+
173
+
174
+ <div class="method_details first">
175
+ <h3 class="signature first" id="define_meter-instance_method">
176
+
177
+ - (<tt>Object</tt>) <strong>define_meter</strong>(name, klass_name = self.class.name, time_unit = Simple::Metrics::DEFAULT_RATE_UNIT)
178
+
179
+
180
+
181
+
182
+
183
+ </h3><div class="docstring">
184
+ <div class="discussion">
185
+
186
+ <p>Create a new meter</p>
187
+
188
+ <p>`self.class.name` TimeUnit::SECONDS</p>
189
+
190
+
191
+ </div>
192
+ </div>
193
+ <div class="tags">
194
+ <p class="tag_title">Parameters:</p>
195
+ <ul class="param">
196
+
197
+ <li>
198
+
199
+ <span class='name'>name</span>
200
+
201
+
202
+ <span class='type'>(<tt>String</tt>)</span>
203
+
204
+
205
+
206
+ &mdash;
207
+ <div class='inline'>
208
+ <p>The name of the meter</p>
209
+ </div>
210
+
211
+ </li>
212
+
213
+ <li>
214
+
215
+ <span class='name'>klass_name</span>
216
+
217
+
218
+ <span class='type'>(<tt>String</tt>)</span>
219
+
220
+
221
+ <em class="default">(defaults to: <tt>self.class.name</tt>)</em>
222
+
223
+
224
+ &mdash;
225
+ <div class='inline'>
226
+ <p>The name of the class, usually the application. Defaults to</p>
227
+ </div>
228
+
229
+ </li>
230
+
231
+ <li>
232
+
233
+ <span class='name'>time_unit</span>
234
+
235
+
236
+ <span class='type'>(<tt>TimeUnit</tt>)</span>
237
+
238
+
239
+ <em class="default">(defaults to: <tt>Simple::Metrics::DEFAULT_RATE_UNIT</tt>)</em>
240
+
241
+
242
+ &mdash;
243
+ <div class='inline'>
244
+ <p>The rate at which to measure marked data. Defaults to</p>
245
+ </div>
246
+
247
+ </li>
248
+
249
+ </ul>
250
+
251
+
252
+ </div><table class="source_code">
253
+ <tr>
254
+ <td>
255
+ <pre class="lines">
256
+
257
+
258
+ 13
259
+ 14
260
+ 15
261
+ 16
262
+ 17
263
+ 18
264
+ 19
265
+ 20</pre>
266
+ </td>
267
+ <td>
268
+ <pre class="code"><span class="info file"># File 'lib/simple/metrics/meter.rb', line 13</span>
269
+
270
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_define_meter identifier id'>define_meter</span><span class='lparen token'>(</span><span class='rubyid_name identifier id'>name</span><span class='comma token'>,</span> <span class='rubyid_klass_name identifier id'>klass_name</span> <span class='assign token'>=</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_class identifier id'>class</span><span class='dot token'>.</span><span class='rubyid_name identifier id'>name</span><span class='comma token'>,</span> <span class='rubyid_time_unit identifier id'>time_unit</span> <span class='assign token'>=</span> <span class='rubyid_Simple constant id'>Simple</span><span class='colon2 op'>::</span><span class='rubyid_Metrics constant id'>Metrics</span><span class='colon2 op'>::</span><span class='rubyid_DEFAULT_RATE_UNIT constant id'>DEFAULT_RATE_UNIT</span><span class='rparen token'>)</span>
271
+ <span class='rubyid_type identifier id'>type</span> <span class='assign token'>=</span> <span class='string val'>&quot;meter&quot;</span>
272
+ <span class='rubyid_metric_name identifier id'>metric_name</span> <span class='assign token'>=</span> <span class='rubyid_new_metric_name identifier id'>new_metric_name</span><span class='lparen token'>(</span><span class='rubyid_klass_name identifier id'>klass_name</span><span class='comma token'>,</span> <span class='rubyid_name identifier id'>name</span><span class='comma token'>,</span> <span class='rubyid_type identifier id'>type</span><span class='rparen token'>)</span>
273
+ <span class='rubyid_meter identifier id'>meter</span> <span class='assign token'>=</span> <span class='rubyid_Java constant id'>Java</span><span class='colon2 op'>::</span><span class='rubyid_ComYammerMetrics constant id'>ComYammerMetrics</span><span class='colon2 op'>::</span><span class='rubyid_Metrics constant id'>Metrics</span><span class='dot token'>.</span><span class='rubyid_new_meter identifier id'>new_meter</span><span class='lparen token'>(</span><span class='rubyid_metric_name identifier id'>metric_name</span><span class='comma token'>,</span> <span class='rubyid_name identifier id'>name</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span><span class='comma token'>,</span> <span class='rubyid_time_unit identifier id'>time_unit</span><span class='rparen token'>)</span>
274
+ <span class='rubyid_define_method identifier id'>define_method</span><span class='lparen token'>(</span><span class='dstring node'>&quot;#{name}&quot;</span><span class='rparen token'>)</span> <span class='rubyid_do do kw'>do</span>
275
+ <span class='rubyid_meter identifier id'>meter</span>
276
+ <span class='rubyid_end end kw'>end</span>
277
+ <span class='rubyid_end end kw'>end</span>
278
+ </pre>
279
+ </td>
280
+ </tr>
281
+ </table>
282
+ </div>
283
+
284
+ </div>
285
+
286
+ </div>
287
+
288
+ <div id="footer">
289
+ Generated on Mon May 13 23:22:15 2013 by
290
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
291
+ 0.8.3 (ruby-1.9.3).
292
+ </div>
293
+
294
+ </body>
295
+ </html>
@@ -0,0 +1,366 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: Simple::Metrics::RackMetrics
8
+
9
+ &mdash; Documentation by YARD 0.8.3
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../../';
20
+ framesUrl = "../../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../../_index.html">Index (R)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../Simple.html" title="Simple (module)">Simple</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Metrics.html" title="Simple::Metrics (module)">Metrics</a></span></span>
36
+ &raquo;
37
+ <span class="title">RackMetrics</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: Simple::Metrics::RackMetrics
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">Simple::Metrics::RackMetrics</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+ <dt class="r2">Extended by:</dt>
92
+ <dd class="r2"><span class='object_link'><a href="Meter.html" title="Simple::Metrics::Meter (module)">Meter</a></span></dd>
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+ <dt class="r1 last">Defined in:</dt>
101
+ <dd class="r1 last">lib/simple/metrics/rack_metrics.rb</dd>
102
+
103
+ </dl>
104
+ <div class="clear"></div>
105
+
106
+
107
+
108
+
109
+ <h2>Constant Summary</h2>
110
+
111
+ <h3 class="inherited">Constants included
112
+ from <span class='object_link'><a href="../Metrics.html" title="Simple::Metrics (module)">Simple::Metrics</a></span></h3>
113
+ <p class="inherited"><span class='object_link'><a href="../Metrics.html#DEFAULT_DURATION_UNIT-constant" title="Simple::Metrics::DEFAULT_DURATION_UNIT (constant)">DEFAULT_DURATION_UNIT</a></span>, <span class='object_link'><a href="../Metrics.html#DEFAULT_RATE_UNIT-constant" title="Simple::Metrics::DEFAULT_RATE_UNIT (constant)">DEFAULT_RATE_UNIT</a></span>, <span class='object_link'><a href="../Metrics.html#DEFAULT_TIMING_UNIT-constant" title="Simple::Metrics::DEFAULT_TIMING_UNIT (constant)">DEFAULT_TIMING_UNIT</a></span>, <span class='object_link'><a href="../Metrics.html#VERSION-constant" title="Simple::Metrics::VERSION (constant)">VERSION</a></span></p>
114
+
115
+
116
+
117
+
118
+
119
+
120
+ <h2>
121
+ Instance Method Summary
122
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
123
+ </h2>
124
+
125
+ <ul class="summary">
126
+
127
+ <li class="public ">
128
+ <span class="summary_signature">
129
+
130
+ <a href="#call-instance_method" title="#call (instance method)">- (Object) <strong>call</strong>(env) </a>
131
+
132
+
133
+
134
+ </span>
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+ <span class="summary_desc"><div class='inline'></div></span>
145
+
146
+ </li>
147
+
148
+
149
+ <li class="public ">
150
+ <span class="summary_signature">
151
+
152
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (RackMetrics) <strong>initialize</strong>(app, application_name) </a>
153
+
154
+
155
+
156
+ </span>
157
+
158
+
159
+ <span class="note title constructor">constructor</span>
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+ <span class="summary_desc"><div class='inline'>
169
+ <p>Rack middleware for capturing response codes.</p>
170
+ </div></span>
171
+
172
+ </li>
173
+
174
+
175
+ </ul>
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="Meter.html" title="Simple::Metrics::Meter (module)">Meter</a></span></h3>
188
+ <p class="inherited"><span class='object_link'><a href="Meter.html#define_meter-instance_method" title="Simple::Metrics::Meter#define_meter (method)">define_meter</a></span></p>
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="../Metrics.html" title="Simple::Metrics (module)">Simple::Metrics</a></span></h3>
199
+ <p class="inherited"><span class='object_link'><a href="../Metrics.html#metrics_registry-instance_method" title="Simple::Metrics#metrics_registry (method)">#metrics_registry</a></span>, <span class='object_link'><a href="../Metrics.html#new_metric_name-instance_method" title="Simple::Metrics#new_metric_name (method)">#new_metric_name</a></span>, <span class='object_link'><a href="../Metrics.html#sanitize_classname-instance_method" title="Simple::Metrics#sanitize_classname (method)">#sanitize_classname</a></span></p>
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="Timer.html" title="Simple::Metrics::Timer (module)">Timer</a></span></h3>
210
+ <p class="inherited"><span class='object_link'><a href="Timer.html#timer-instance_method" title="Simple::Metrics::Timer#timer (method)">#timer</a></span></p>
211
+ <div id="constructor_details" class="method_details_list">
212
+ <h2>Constructor Details</h2>
213
+
214
+ <div class="method_details first">
215
+ <h3 class="signature first" id="initialize-instance_method">
216
+
217
+ - (<tt><span class='object_link'><a href="" title="Simple::Metrics::RackMetrics (class)">RackMetrics</a></span></tt>) <strong>initialize</strong>(app, application_name)
218
+
219
+
220
+
221
+
222
+
223
+ </h3><div class="docstring">
224
+ <div class="discussion">
225
+
226
+ <p>Rack middleware for capturing response codes</p>
227
+
228
+ <p>Creates a series of response meters that will be marked based on the
229
+ response code that is returned by rack.</p>
230
+
231
+
232
+ </div>
233
+ </div>
234
+ <div class="tags">
235
+ <p class="tag_title">Parameters:</p>
236
+ <ul class="param">
237
+
238
+ <li>
239
+
240
+ <span class='name'>app</span>
241
+
242
+
243
+ <span class='type'>(<tt>Object</tt>)</span>
244
+
245
+
246
+
247
+ &mdash;
248
+ <div class='inline'>
249
+ <p>Rack application</p>
250
+ </div>
251
+
252
+ </li>
253
+
254
+ <li>
255
+
256
+ <span class='name'>application_name</span>
257
+
258
+
259
+ <span class='type'>(<tt>String</tt>)</span>
260
+
261
+
262
+
263
+ &mdash;
264
+ <div class='inline'>
265
+ <p>The name of the application</p>
266
+ </div>
267
+
268
+ </li>
269
+
270
+ </ul>
271
+
272
+
273
+ </div><table class="source_code">
274
+ <tr>
275
+ <td>
276
+ <pre class="lines">
277
+
278
+
279
+ 12
280
+ 13
281
+ 14
282
+ 15
283
+ 16
284
+ 17
285
+ 18
286
+ 19</pre>
287
+ </td>
288
+ <td>
289
+ <pre class="code"><span class="info file"># File 'lib/simple/metrics/rack_metrics.rb', line 12</span>
290
+
291
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='rubyid_app identifier id'>app</span><span class='comma token'>,</span> <span class='rubyid_application_name identifier id'>application_name</span><span class='rparen token'>)</span>
292
+ <span class='rubyid_@app ivar id'>@app</span> <span class='assign token'>=</span> <span class='rubyid_app identifier id'>app</span>
293
+
294
+ <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_class identifier id'>class</span><span class='dot token'>.</span><span class='rubyid_define_meter identifier id'>define_meter</span> <span class='string val'>'2xx-responses'</span><span class='comma token'>,</span> <span class='rubyid_application_name identifier id'>application_name</span>
295
+ <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_class identifier id'>class</span><span class='dot token'>.</span><span class='rubyid_define_meter identifier id'>define_meter</span> <span class='string val'>'3xx-responses'</span><span class='comma token'>,</span> <span class='rubyid_application_name identifier id'>application_name</span>
296
+ <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_class identifier id'>class</span><span class='dot token'>.</span><span class='rubyid_define_meter identifier id'>define_meter</span> <span class='string val'>'4xx-responses'</span><span class='comma token'>,</span> <span class='rubyid_application_name identifier id'>application_name</span>
297
+ <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_class identifier id'>class</span><span class='dot token'>.</span><span class='rubyid_define_meter identifier id'>define_meter</span> <span class='string val'>'5xx-responses'</span><span class='comma token'>,</span> <span class='rubyid_application_name identifier id'>application_name</span>
298
+ <span class='rubyid_end end kw'>end</span>
299
+ </pre>
300
+ </td>
301
+ </tr>
302
+ </table>
303
+ </div>
304
+
305
+ </div>
306
+
307
+
308
+ <div id="instance_method_details" class="method_details_list">
309
+ <h2>Instance Method Details</h2>
310
+
311
+
312
+ <div class="method_details first">
313
+ <h3 class="signature first" id="call-instance_method">
314
+
315
+ - (<tt>Object</tt>) <strong>call</strong>(env)
316
+
317
+
318
+
319
+
320
+
321
+ </h3><table class="source_code">
322
+ <tr>
323
+ <td>
324
+ <pre class="lines">
325
+
326
+
327
+ 21
328
+ 22
329
+ 23
330
+ 24
331
+ 25
332
+ 26
333
+ 27
334
+ 28
335
+ 29</pre>
336
+ </td>
337
+ <td>
338
+ <pre class="code"><span class="info file"># File 'lib/simple/metrics/rack_metrics.rb', line 21</span>
339
+
340
+ <span class='rubyid_def def kw'>def</span> <span class='rubyid_call identifier id'>call</span><span class='lparen token'>(</span><span class='rubyid_env identifier id'>env</span><span class='rparen token'>)</span>
341
+ <span class='rubyid_begin begin kw'>begin</span>
342
+ <span class='rubyid_status identifier id'>status</span><span class='comma token'>,</span> <span class='rubyid_headers identifier id'>headers</span><span class='comma token'>,</span> <span class='rubyid_body identifier id'>body</span> <span class='assign token'>=</span> <span class='rubyid_@app ivar id'>@app</span><span class='dot token'>.</span><span class='rubyid_call identifier id'>call</span><span class='lparen token'>(</span><span class='rubyid_env identifier id'>env</span><span class='rparen token'>)</span>
343
+ <span class='rubyid_ensure ensure kw'>ensure</span>
344
+ <span class='rubyid_status_code identifier id'>status_code</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='rubyid_status identifier id'>status</span> <span class='opasgn op'>||=</span> <span class='integer val'>500</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span>
345
+ <span class='rubyid_status_method identifier id'>status_method</span> <span class='assign token'>=</span> <span class='dstring node'>&quot;#{status_code}xx-responses&quot;</span><span class='dot token'>.</span><span class='rubyid_to_sym identifier id'>to_sym</span>
346
+ <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_send identifier id'>send</span><span class='lparen token'>(</span><span class='rubyid_status_method identifier id'>status_method</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_mark identifier id'>mark</span>
347
+ <span class='rubyid_end end kw'>end</span>
348
+ <span class='rubyid_end end kw'>end</span>
349
+ </pre>
350
+ </td>
351
+ </tr>
352
+ </table>
353
+ </div>
354
+
355
+ </div>
356
+
357
+ </div>
358
+
359
+ <div id="footer">
360
+ Generated on Mon May 13 23:22:16 2013 by
361
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
362
+ 0.8.3 (ruby-1.9.3).
363
+ </div>
364
+
365
+ </body>
366
+ </html>