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,425 @@
|
|
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::Healthchecks
|
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 (H)</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">Healthchecks</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::Healthchecks
|
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="../../NurseRatched.html" title="NurseRatched (class)">NurseRatched</a></span></dd>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
<dt class="r1 last">Defined in:</dt>
|
90
|
+
<dd class="r1 last">lib/simple/metrics/healthcheck.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="#new_healthcheck-instance_method" title="#new_healthcheck (instance method)">- (MetricName) <strong>new_healthcheck</strong>(name, &blk) </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 healthcheck.
|
138
|
+
</p>
|
139
|
+
</div></span>
|
140
|
+
|
141
|
+
</li>
|
142
|
+
|
143
|
+
|
144
|
+
<li class="public ">
|
145
|
+
<span class="summary_signature">
|
146
|
+
|
147
|
+
<a href="#run_all_healthchecks-instance_method" title="#run_all_healthchecks (instance method)">- (Object) <strong>run_all_healthchecks</strong> </a>
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
</span>
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
<span class="summary_desc"><div class='inline'><p>
|
162
|
+
Run all of the healthchecks that have been defined.
|
163
|
+
</p>
|
164
|
+
</div></span>
|
165
|
+
|
166
|
+
</li>
|
167
|
+
|
168
|
+
|
169
|
+
<li class="public ">
|
170
|
+
<span class="summary_signature">
|
171
|
+
|
172
|
+
<a href="#run_healthcheck_loop-instance_method" title="#run_healthcheck_loop (instance method)">- (Object) <strong>run_healthcheck_loop</strong> </a>
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
</span>
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
<span class="summary_desc"><div class='inline'><p>
|
187
|
+
Run the healthcheck loop This starts a new thread that runs all of the
|
188
|
+
defined healthcheck loops.
|
189
|
+
</p>
|
190
|
+
</div></span>
|
191
|
+
|
192
|
+
</li>
|
193
|
+
|
194
|
+
|
195
|
+
</ul>
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Metrics.html" title="Simple::Metrics (module)">Simple::Metrics</a></span></h3>
|
208
|
+
<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>
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="Timer.html" title="Simple::Metrics::Timer (module)">Timer</a></span></h3>
|
219
|
+
<p class="inherited"><span class='object_link'><a href="Timer.html#timer-instance_method" title="Simple::Metrics::Timer#timer (method)">#timer</a></span></p>
|
220
|
+
|
221
|
+
|
222
|
+
<div id="instance_method_details" class="method_details_list">
|
223
|
+
<h2>Instance Method Details</h2>
|
224
|
+
|
225
|
+
|
226
|
+
<div class="method_details first">
|
227
|
+
<h3 class="signature first" id="new_healthcheck-instance_method">
|
228
|
+
|
229
|
+
- (<tt>MetricName</tt>) <strong>new_healthcheck</strong>(name, &blk)
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
</h3><div class="docstring">
|
236
|
+
<div class="discussion">
|
237
|
+
<p>
|
238
|
+
Create a new healthcheck
|
239
|
+
</p>
|
240
|
+
|
241
|
+
|
242
|
+
</div>
|
243
|
+
</div>
|
244
|
+
<div class="tags">
|
245
|
+
<p class="tag_title">Parameters:</p>
|
246
|
+
<ul class="param">
|
247
|
+
|
248
|
+
<li>
|
249
|
+
|
250
|
+
<span class='name'>name</span>
|
251
|
+
|
252
|
+
|
253
|
+
<span class='type'>(<tt>String</tt>)</span>
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
—
|
258
|
+
<div class='inline'><p>
|
259
|
+
The name of the healthcheck, eg `check_db`.
|
260
|
+
</p>
|
261
|
+
</div>
|
262
|
+
|
263
|
+
</li>
|
264
|
+
|
265
|
+
</ul>
|
266
|
+
|
267
|
+
<p class="tag_title">Returns:</p>
|
268
|
+
<ul class="return">
|
269
|
+
|
270
|
+
<li>
|
271
|
+
|
272
|
+
|
273
|
+
<span class='type'>(<tt>MetricName</tt>)</span>
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
—
|
278
|
+
<div class='inline'><p>
|
279
|
+
the newly created metric name
|
280
|
+
</p>
|
281
|
+
</div>
|
282
|
+
|
283
|
+
</li>
|
284
|
+
|
285
|
+
</ul>
|
286
|
+
|
287
|
+
</div><table class="source_code">
|
288
|
+
<tr>
|
289
|
+
<td>
|
290
|
+
<pre class="lines">
|
291
|
+
|
292
|
+
|
293
|
+
12
|
294
|
+
13
|
295
|
+
14
|
296
|
+
15
|
297
|
+
16</pre>
|
298
|
+
</td>
|
299
|
+
<td>
|
300
|
+
<pre class="code"><span class="info file"># File 'lib/simple/metrics/healthcheck.rb', line 12</span>
|
301
|
+
|
302
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_new_healthcheck identifier id'>new_healthcheck</span><span class='lparen token'>(</span><span class='rubyid_name identifier id'>name</span><span class='comma token'>,</span> <span class='bitand op'>&</span><span class='rubyid_blk identifier id'>blk</span><span class='rparen token'>)</span>
|
303
|
+
<span class='rubyid_healthcheck identifier id'>healthcheck</span> <span class='assign token'>=</span> <span class='rubyid_Check constant id'>Check</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_name identifier id'>name</span><span class='comma token'>,</span> <span class='bitand op'>&</span><span class='rubyid_blk identifier id'>blk</span><span class='rparen token'>)</span>
|
304
|
+
<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_HealthChecks constant id'>HealthChecks</span><span class='dot token'>.</span><span class='rubyid_register identifier id'>register</span><span class='lparen token'>(</span><span class='rubyid_healthcheck identifier id'>healthcheck</span><span class='rparen token'>)</span>
|
305
|
+
<span class='rubyid_run_healthcheck_loop identifier id'>run_healthcheck_loop</span>
|
306
|
+
<span class='rubyid_end end kw'>end</span>
|
307
|
+
</pre>
|
308
|
+
</td>
|
309
|
+
</tr>
|
310
|
+
</table>
|
311
|
+
</div>
|
312
|
+
|
313
|
+
<div class="method_details ">
|
314
|
+
<h3 class="signature " id="run_all_healthchecks-instance_method">
|
315
|
+
|
316
|
+
- (<tt>Object</tt>) <strong>run_all_healthchecks</strong>
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
</h3><div class="docstring">
|
323
|
+
<div class="discussion">
|
324
|
+
<p>
|
325
|
+
Run all of the healthchecks that have been defined
|
326
|
+
</p>
|
327
|
+
|
328
|
+
|
329
|
+
</div>
|
330
|
+
</div>
|
331
|
+
<div class="tags">
|
332
|
+
|
333
|
+
|
334
|
+
</div><table class="source_code">
|
335
|
+
<tr>
|
336
|
+
<td>
|
337
|
+
<pre class="lines">
|
338
|
+
|
339
|
+
|
340
|
+
32
|
341
|
+
33
|
342
|
+
34</pre>
|
343
|
+
</td>
|
344
|
+
<td>
|
345
|
+
<pre class="code"><span class="info file"># File 'lib/simple/metrics/healthcheck.rb', line 32</span>
|
346
|
+
|
347
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_run_all_healthchecks identifier id'>run_all_healthchecks</span>
|
348
|
+
<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_HealthChecks constant id'>HealthChecks</span><span class='dot token'>.</span><span class='rubyid_runHealthChecks identifier id'>runHealthChecks</span>
|
349
|
+
<span class='rubyid_end end kw'>end</span>
|
350
|
+
</pre>
|
351
|
+
</td>
|
352
|
+
</tr>
|
353
|
+
</table>
|
354
|
+
</div>
|
355
|
+
|
356
|
+
<div class="method_details ">
|
357
|
+
<h3 class="signature " id="run_healthcheck_loop-instance_method">
|
358
|
+
|
359
|
+
- (<tt>Object</tt>) <strong>run_healthcheck_loop</strong>
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
</h3><div class="docstring">
|
366
|
+
<div class="discussion">
|
367
|
+
<p>
|
368
|
+
Run the healthcheck loop This starts a new thread that runs all of the
|
369
|
+
defined healthcheck loops.
|
370
|
+
</p>
|
371
|
+
|
372
|
+
|
373
|
+
</div>
|
374
|
+
</div>
|
375
|
+
<div class="tags">
|
376
|
+
|
377
|
+
|
378
|
+
</div><table class="source_code">
|
379
|
+
<tr>
|
380
|
+
<td>
|
381
|
+
<pre class="lines">
|
382
|
+
|
383
|
+
|
384
|
+
20
|
385
|
+
21
|
386
|
+
22
|
387
|
+
23
|
388
|
+
24
|
389
|
+
25
|
390
|
+
26
|
391
|
+
27
|
392
|
+
28
|
393
|
+
29</pre>
|
394
|
+
</td>
|
395
|
+
<td>
|
396
|
+
<pre class="code"><span class="info file"># File 'lib/simple/metrics/healthcheck.rb', line 20</span>
|
397
|
+
|
398
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_run_healthcheck_loop identifier id'>run_healthcheck_loop</span>
|
399
|
+
<span class='rubyid_return return kw'>return</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_@running_healthcheck_loop ivar id'>@running_healthcheck_loop</span>
|
400
|
+
<span class='rubyid_Thread constant id'>Thread</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span> <span class='rubyid_do do kw'>do</span>
|
401
|
+
<span class='rubyid_loop identifier id'>loop</span> <span class='rubyid_do do kw'>do</span>
|
402
|
+
<span class='rubyid_run_all_healthchecks identifier id'>run_all_healthchecks</span>
|
403
|
+
<span class='rubyid_sleep identifier id'>sleep</span> <span class='integer val'>5</span>
|
404
|
+
<span class='rubyid_end end kw'>end</span>
|
405
|
+
<span class='rubyid_end end kw'>end</span>
|
406
|
+
<span class='rubyid_@running_healthcheck_loop ivar id'>@running_healthcheck_loop</span> <span class='assign token'>=</span> <span class='rubyid_true true kw'>true</span>
|
407
|
+
<span class='rubyid_end end kw'>end</span>
|
408
|
+
</pre>
|
409
|
+
</td>
|
410
|
+
</tr>
|
411
|
+
</table>
|
412
|
+
</div>
|
413
|
+
|
414
|
+
</div>
|
415
|
+
|
416
|
+
</div>
|
417
|
+
|
418
|
+
<div id="footer">
|
419
|
+
Generated on Mon Nov 05 22:03:44 2012 by
|
420
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
421
|
+
0.8.3 (ruby-1.9.2).
|
422
|
+
</div>
|
423
|
+
|
424
|
+
</body>
|
425
|
+
</html>
|