simple-metrics 0.0.10-java
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/.rbenv-version +1 -0
- data/.rspec +2 -0
- data/Gemfile +4 -0
- data/LICENSE +13 -0
- data/README.md +126 -0
- data/Rakefile +7 -0
- data/doc/NurseRatched.html +246 -0
- data/doc/Rdio.html +245 -0
- data/doc/Samovar.html +241 -0
- data/doc/Simple/Metrics/Check.html +312 -0
- data/doc/Simple/Metrics/Graphite.html +268 -0
- data/doc/Simple/Metrics/HEALTHY.html +144 -0
- data/doc/Simple/Metrics/Health.html +292 -0
- data/doc/Simple/Metrics/Healthchecks.html +425 -0
- data/doc/Simple/Metrics/Meter.html +284 -0
- data/doc/Simple/Metrics/RackMetrics.html +371 -0
- data/doc/Simple/Metrics/Timer.html +235 -0
- data/doc/Simple/Metrics/UNHEALTHY.html +144 -0
- data/doc/Simple/Metrics/WARNING.html +144 -0
- data/doc/Simple/Metrics.html +523 -0
- data/doc/Simple.html +117 -0
- data/doc/_index.html +277 -0
- data/doc/class_list.html +53 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +328 -0
- data/doc/file.README.html +210 -0
- data/doc/file_list.html +55 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +210 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +196 -0
- data/doc/top-level-namespace.html +114 -0
- data/lib/java/jackson-core-asl-1.9.5.jar +0 -0
- data/lib/java/jackson-mapper-asl-1.9.5.jar +0 -0
- data/lib/java/metrics-core-2.1.1.jar +0 -0
- data/lib/java/metrics-graphite-2.1.1.jar +0 -0
- data/lib/java/metrics-servlet-2.1.1.jar +0 -0
- data/lib/java/slf4j-api-1.6.4.jar +0 -0
- data/lib/simple/metrics/graphite.rb +23 -0
- data/lib/simple/metrics/health.rb +15 -0
- data/lib/simple/metrics/healthcheck.rb +65 -0
- data/lib/simple/metrics/meter.rb +22 -0
- data/lib/simple/metrics/rack_metrics.rb +32 -0
- data/lib/simple/metrics/timer.rb +22 -0
- data/lib/simple/metrics.rb +51 -0
- data/lib/simple/version.rb +5 -0
- data/lib/simple.rb +6 -0
- data/simple-metrics.gemspec +21 -0
- data/spec/metrics/graphite_spec.rb +9 -0
- data/spec/metrics/healthcheck_spec.rb +55 -0
- data/spec/metrics/meter_spec.rb +20 -0
- data/spec/metrics/timer_spec.rb +29 -0
- data/spec/spec_helper.rb +13 -0
- metadata +174 -0
@@ -0,0 +1,284 @@
|
|
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
|
+
— 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> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../Simple.html" title="Simple (module)">Simple</a></span></span> » <span class='title'><span class='object_link'><a href="../Metrics.html" title="Simple::Metrics (module)">Metrics</a></span></span>
|
36
|
+
»
|
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) </a>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
</span>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
<span class="summary_desc"><div class='inline'><p>
|
137
|
+
Create a new meter.
|
138
|
+
</p>
|
139
|
+
</div></span>
|
140
|
+
|
141
|
+
</li>
|
142
|
+
|
143
|
+
|
144
|
+
</ul>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Metrics.html" title="Simple::Metrics (module)">Simple::Metrics</a></span></h3>
|
157
|
+
<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>
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="Timer.html" title="Simple::Metrics::Timer (module)">Timer</a></span></h3>
|
168
|
+
<p class="inherited"><span class='object_link'><a href="Timer.html#timer-instance_method" title="Simple::Metrics::Timer#timer (method)">#timer</a></span></p>
|
169
|
+
|
170
|
+
|
171
|
+
<div id="instance_method_details" class="method_details_list">
|
172
|
+
<h2>Instance Method Details</h2>
|
173
|
+
|
174
|
+
|
175
|
+
<div class="method_details first">
|
176
|
+
<h3 class="signature first" id="define_meter-instance_method">
|
177
|
+
|
178
|
+
- (<tt>Object</tt>) <strong>define_meter</strong>(name, klass_name = self.class.name)
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
</h3><div class="docstring">
|
185
|
+
<div class="discussion">
|
186
|
+
<p>
|
187
|
+
Create a new meter
|
188
|
+
</p>
|
189
|
+
<p>
|
190
|
+
`self.class.name`
|
191
|
+
</p>
|
192
|
+
|
193
|
+
|
194
|
+
</div>
|
195
|
+
</div>
|
196
|
+
<div class="tags">
|
197
|
+
<p class="tag_title">Parameters:</p>
|
198
|
+
<ul class="param">
|
199
|
+
|
200
|
+
<li>
|
201
|
+
|
202
|
+
<span class='name'>name</span>
|
203
|
+
|
204
|
+
|
205
|
+
<span class='type'>(<tt>String</tt>)</span>
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
—
|
210
|
+
<div class='inline'><p>
|
211
|
+
The name of the meter
|
212
|
+
</p>
|
213
|
+
</div>
|
214
|
+
|
215
|
+
</li>
|
216
|
+
|
217
|
+
<li>
|
218
|
+
|
219
|
+
<span class='name'>klass_name</span>
|
220
|
+
|
221
|
+
|
222
|
+
<span class='type'>(<tt>String</tt>)</span>
|
223
|
+
|
224
|
+
|
225
|
+
<em class="default">(defaults to: <tt>self.class.name</tt>)</em>
|
226
|
+
|
227
|
+
|
228
|
+
—
|
229
|
+
<div class='inline'><p>
|
230
|
+
The name of the class, usually the application. Defaults to
|
231
|
+
</p>
|
232
|
+
</div>
|
233
|
+
|
234
|
+
</li>
|
235
|
+
|
236
|
+
</ul>
|
237
|
+
|
238
|
+
|
239
|
+
</div><table class="source_code">
|
240
|
+
<tr>
|
241
|
+
<td>
|
242
|
+
<pre class="lines">
|
243
|
+
|
244
|
+
|
245
|
+
11
|
246
|
+
12
|
247
|
+
13
|
248
|
+
14
|
249
|
+
15
|
250
|
+
16
|
251
|
+
17
|
252
|
+
18
|
253
|
+
19</pre>
|
254
|
+
</td>
|
255
|
+
<td>
|
256
|
+
<pre class="code"><span class="info file"># File 'lib/simple/metrics/meter.rb', line 11</span>
|
257
|
+
|
258
|
+
<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='rparen token'>)</span>
|
259
|
+
<span class='rubyid_type identifier id'>type</span> <span class='assign token'>=</span> <span class='string val'>"meter"</span>
|
260
|
+
<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>
|
261
|
+
<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>
|
262
|
+
<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>
|
263
|
+
<span class='rubyid_define_method identifier id'>define_method</span><span class='lparen token'>(</span><span class='dstring node'>"#{name}"</span><span class='rparen token'>)</span> <span class='rubyid_do do kw'>do</span>
|
264
|
+
<span class='rubyid_meter identifier id'>meter</span>
|
265
|
+
<span class='rubyid_end end kw'>end</span>
|
266
|
+
<span class='rubyid_end end kw'>end</span>
|
267
|
+
</pre>
|
268
|
+
</td>
|
269
|
+
</tr>
|
270
|
+
</table>
|
271
|
+
</div>
|
272
|
+
|
273
|
+
</div>
|
274
|
+
|
275
|
+
</div>
|
276
|
+
|
277
|
+
<div id="footer">
|
278
|
+
Generated on Mon Nov 05 22:03:43 2012 by
|
279
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
280
|
+
0.8.3 (ruby-1.9.2).
|
281
|
+
</div>
|
282
|
+
|
283
|
+
</body>
|
284
|
+
</html>
|
@@ -0,0 +1,371 @@
|
|
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
|
+
— 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> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../Simple.html" title="Simple (module)">Simple</a></span></span> » <span class='title'><span class='object_link'><a href="../Metrics.html" title="Simple::Metrics (module)">Metrics</a></span></span>
|
36
|
+
»
|
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'><p>
|
169
|
+
Rack middleware for capturing response codes.
|
170
|
+
</p>
|
171
|
+
</div></span>
|
172
|
+
|
173
|
+
</li>
|
174
|
+
|
175
|
+
|
176
|
+
</ul>
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="Meter.html" title="Simple::Metrics::Meter (module)">Meter</a></span></h3>
|
189
|
+
<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>
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Metrics.html" title="Simple::Metrics (module)">Simple::Metrics</a></span></h3>
|
200
|
+
<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>
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="Timer.html" title="Simple::Metrics::Timer (module)">Timer</a></span></h3>
|
211
|
+
<p class="inherited"><span class='object_link'><a href="Timer.html#timer-instance_method" title="Simple::Metrics::Timer#timer (method)">#timer</a></span></p>
|
212
|
+
<div id="constructor_details" class="method_details_list">
|
213
|
+
<h2>Constructor Details</h2>
|
214
|
+
|
215
|
+
<div class="method_details first">
|
216
|
+
<h3 class="signature first" id="initialize-instance_method">
|
217
|
+
|
218
|
+
- (<tt><span class='object_link'><a href="" title="Simple::Metrics::RackMetrics (class)">RackMetrics</a></span></tt>) <strong>initialize</strong>(app, application_name)
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
</h3><div class="docstring">
|
225
|
+
<div class="discussion">
|
226
|
+
<p>
|
227
|
+
Rack middleware for capturing response codes
|
228
|
+
</p>
|
229
|
+
<p>
|
230
|
+
Creates a series of response meters that will be marked based on the
|
231
|
+
response code that is returned by rack.
|
232
|
+
</p>
|
233
|
+
|
234
|
+
|
235
|
+
</div>
|
236
|
+
</div>
|
237
|
+
<div class="tags">
|
238
|
+
<p class="tag_title">Parameters:</p>
|
239
|
+
<ul class="param">
|
240
|
+
|
241
|
+
<li>
|
242
|
+
|
243
|
+
<span class='name'>app</span>
|
244
|
+
|
245
|
+
|
246
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
—
|
251
|
+
<div class='inline'><p>
|
252
|
+
Rack application
|
253
|
+
</p>
|
254
|
+
</div>
|
255
|
+
|
256
|
+
</li>
|
257
|
+
|
258
|
+
<li>
|
259
|
+
|
260
|
+
<span class='name'>application_name</span>
|
261
|
+
|
262
|
+
|
263
|
+
<span class='type'>(<tt>String</tt>)</span>
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
—
|
268
|
+
<div class='inline'><p>
|
269
|
+
The name of the application
|
270
|
+
</p>
|
271
|
+
</div>
|
272
|
+
|
273
|
+
</li>
|
274
|
+
|
275
|
+
</ul>
|
276
|
+
|
277
|
+
|
278
|
+
</div><table class="source_code">
|
279
|
+
<tr>
|
280
|
+
<td>
|
281
|
+
<pre class="lines">
|
282
|
+
|
283
|
+
|
284
|
+
12
|
285
|
+
13
|
286
|
+
14
|
287
|
+
15
|
288
|
+
16
|
289
|
+
17
|
290
|
+
18
|
291
|
+
19</pre>
|
292
|
+
</td>
|
293
|
+
<td>
|
294
|
+
<pre class="code"><span class="info file"># File 'lib/simple/metrics/rack_metrics.rb', line 12</span>
|
295
|
+
|
296
|
+
<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>
|
297
|
+
<span class='rubyid_@app ivar id'>@app</span> <span class='assign token'>=</span> <span class='rubyid_app identifier id'>app</span>
|
298
|
+
|
299
|
+
<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>
|
300
|
+
<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>
|
301
|
+
<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>
|
302
|
+
<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>
|
303
|
+
<span class='rubyid_end end kw'>end</span>
|
304
|
+
</pre>
|
305
|
+
</td>
|
306
|
+
</tr>
|
307
|
+
</table>
|
308
|
+
</div>
|
309
|
+
|
310
|
+
</div>
|
311
|
+
|
312
|
+
|
313
|
+
<div id="instance_method_details" class="method_details_list">
|
314
|
+
<h2>Instance Method Details</h2>
|
315
|
+
|
316
|
+
|
317
|
+
<div class="method_details first">
|
318
|
+
<h3 class="signature first" id="call-instance_method">
|
319
|
+
|
320
|
+
- (<tt>Object</tt>) <strong>call</strong>(env)
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
</h3><table class="source_code">
|
327
|
+
<tr>
|
328
|
+
<td>
|
329
|
+
<pre class="lines">
|
330
|
+
|
331
|
+
|
332
|
+
21
|
333
|
+
22
|
334
|
+
23
|
335
|
+
24
|
336
|
+
25
|
337
|
+
26
|
338
|
+
27
|
339
|
+
28
|
340
|
+
29</pre>
|
341
|
+
</td>
|
342
|
+
<td>
|
343
|
+
<pre class="code"><span class="info file"># File 'lib/simple/metrics/rack_metrics.rb', line 21</span>
|
344
|
+
|
345
|
+
<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>
|
346
|
+
<span class='rubyid_begin begin kw'>begin</span>
|
347
|
+
<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>
|
348
|
+
<span class='rubyid_ensure ensure kw'>ensure</span>
|
349
|
+
<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>
|
350
|
+
<span class='rubyid_status_method identifier id'>status_method</span> <span class='assign token'>=</span> <span class='dstring node'>"#{status_code}xx-responses"</span><span class='dot token'>.</span><span class='rubyid_to_sym identifier id'>to_sym</span>
|
351
|
+
<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>
|
352
|
+
<span class='rubyid_end end kw'>end</span>
|
353
|
+
<span class='rubyid_end end kw'>end</span>
|
354
|
+
</pre>
|
355
|
+
</td>
|
356
|
+
</tr>
|
357
|
+
</table>
|
358
|
+
</div>
|
359
|
+
|
360
|
+
</div>
|
361
|
+
|
362
|
+
</div>
|
363
|
+
|
364
|
+
<div id="footer">
|
365
|
+
Generated on Mon Nov 05 22:03:45 2012 by
|
366
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
367
|
+
0.8.3 (ruby-1.9.2).
|
368
|
+
</div>
|
369
|
+
|
370
|
+
</body>
|
371
|
+
</html>
|