librato-rack 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +3 -0
- data/README.md +12 -9
- data/lib/librato/rack.rb +1 -1
- data/lib/librato/rack/version.rb +1 -1
- data/test/integration/request_test.rb +3 -0
- metadata +3 -3
- metadata.gz.sig +1 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43bcc15e0b037c711de7dc15bc918d476e5efeb4
|
4
|
+
data.tar.gz: 272c3886d3efe9a35018ce94ab5309006b27b11c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2bcfbf49e5dd485d1e1121731f9bb0fe6b708c6b8ec156faa7356330b2b840546132489660867d35392497d0b71b41b2115b79496adda9e7cdd17be1e061aad
|
7
|
+
data.tar.gz: cec27780849819fc168877a2bf07957fb1363803cc460779ed52b40c5c17307bfb4e674951d62ff428be46315603d010800700d10729947dba1b188fa1c0102b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -41,6 +41,8 @@ In your rackup file or equivalent, require and add the middleware:
|
|
41
41
|
require 'librato-rack'
|
42
42
|
use Librato::Rack
|
43
43
|
|
44
|
+
In order to get the most accurate measurements, it is recommended that the `librato-rack` middleware be the first middleware in your stack. This will ensure that timing measurements like the `rack.request.time` metric will include all of the time spent in the Rack middleware stack.
|
45
|
+
|
44
46
|
If you don't have a Metrics account already, [sign up](https://metrics.librato.com/). In order to send measurements to Metrics you need to provide your account credentials to `librato-rack`. You can provide these one of two ways:
|
45
47
|
|
46
48
|
##### Use environment variables
|
@@ -48,10 +50,11 @@ If you don't have a Metrics account already, [sign up](https://metrics.librato.c
|
|
48
50
|
By default you can use `LIBRATO_USER` and `LIBRATO_TOKEN` to pass your account data to the middleware. While these are the only required variables, there are a few more optional environment variables you may find useful.
|
49
51
|
|
50
52
|
* `LIBRATO_SOURCE` - the default source to use for submitted metrics. If this is not set, hostname of the executing machine will be the default source
|
53
|
+
* `LIBRATO_SUITES` - manage which metrics librato-rack will report. See more in [metrics suites](#metric-suites).
|
51
54
|
* `LIBRATO_PREFIX` - a prefix which will be prepended to all metric names
|
52
|
-
* `LIBRATO_AUTORUN` - set to `'0'` to prevent the reporter from starting, useful if you don't want `librato-rack` to start under certain circumstances
|
53
55
|
* `LIBRATO_LOG_LEVEL` - see logging section for more
|
54
56
|
* `LIBRATO_PROXY` - HTTP proxy to use when connecting to the Librato API (can also use the `https_proxy` or `http_proxy` environment variable commonly supported by Linux command line utilities)
|
57
|
+
* `LIBRATO_AUTORUN` - set to `'0'` to prevent the reporter from starting, useful if you don't want `librato-rack` to start under certain circumstances
|
55
58
|
* `LIBRATO_EVENT_MODE` - use with evented apps, see "Use with EventMachine" below
|
56
59
|
|
57
60
|
##### Use a configuration object
|
@@ -77,15 +80,9 @@ You must also specify a custom source for your app to track properly. If an expl
|
|
77
80
|
|
78
81
|
NOTE: if Heroku idles your application no measurements will be sent until it receives another request and is restarted. If you see intermittent gaps in your measurements during periods of low traffic this is the most likely cause.
|
79
82
|
|
80
|
-
##### Use with EventMachine and EM Synchrony
|
81
|
-
|
82
|
-
`librato-rack` has experimental support for EventMachine and EM Synchrony apps.
|
83
|
-
|
84
|
-
When using in an evented context set LIBRATO_EVENT_MODE to `'eventmachine'` if using [EventMachine](https://github.com/eventmachine/eventmachine) or `'synchrony'` if using [EM Synchrony](https://github.com/igrigorik/em-synchrony) and/or [Rack::FiberPool](https://github.com/alebsack/rack-fiber_pool). We're interested in maturing this support, so please let us know if you have any issues.
|
85
|
-
|
86
83
|
##### Metric Suites
|
87
84
|
|
88
|
-
The metrics recorded by `librato-rack` are organized into named metric suites that can be
|
85
|
+
The metrics recorded by `librato-rack` are organized into named metric suites that can be selectively enabled/disabled:
|
89
86
|
|
90
87
|
* `rack`: The `rack.request.total`, `rack.request.time`, `rack.request.slow`, and `rack.request.queue.time` metrics
|
91
88
|
* `rack_status`: All of the `rack.request.status` metrics
|
@@ -105,6 +102,12 @@ The metric suites can be configured via either the `LIBRATO_SUITES` environment
|
|
105
102
|
|
106
103
|
Note that you should EITHER specify an explict list of suites to enable OR add/subtract individual suites from the default list (using the +/- prefixes). If you try to mix these two forms a `Librato::Rack::InvalidSuiteConfiguration` error will be raised.
|
107
104
|
|
105
|
+
##### Use with EventMachine and EM Synchrony
|
106
|
+
|
107
|
+
`librato-rack` has experimental support for EventMachine and EM Synchrony apps.
|
108
|
+
|
109
|
+
When using in an evented context set LIBRATO_EVENT_MODE to `'eventmachine'` if using [EventMachine](https://github.com/eventmachine/eventmachine) or `'synchrony'` if using [EM Synchrony](https://github.com/igrigorik/em-synchrony) and/or [Rack::FiberPool](https://github.com/alebsack/rack-fiber_pool). We're interested in maturing this support, so please let us know if you have any issues.
|
110
|
+
|
108
111
|
## Custom Measurements
|
109
112
|
|
110
113
|
Tracking anything that interests you is easy with Metrics. There are four primary helpers available:
|
@@ -230,4 +233,4 @@ If you are debugging setup locally you can set `flush_interval` to something sho
|
|
230
233
|
|
231
234
|
## Copyright
|
232
235
|
|
233
|
-
Copyright (c) 2013-
|
236
|
+
Copyright (c) 2013-2016 [Librato Inc.](http://librato.com) See LICENSE for details.
|
data/lib/librato/rack.rb
CHANGED
data/lib/librato/rack/version.rb
CHANGED
@@ -37,6 +37,9 @@ class RequestTest < Minitest::Test
|
|
37
37
|
assert_equal 1, aggregate["rack.request.time"][:count],
|
38
38
|
'should track total request time'
|
39
39
|
|
40
|
+
# should calculte p95 value
|
41
|
+
refute_equal aggregate.fetch("rack.request.time", percentile: 95), 0.0
|
42
|
+
|
40
43
|
# status specific
|
41
44
|
assert_equal 1, aggregate["rack.request.status.200.time"][:count]
|
42
45
|
assert_equal 1, aggregate["rack.request.status.2xx.time"][:count]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: librato-rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Sanders
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
hvjx0WJP8pzZMJPKJBRZQXJO5ifEPyKjZyMi5XMHmrtDclHLj3sx4RAvEZjGWkRP
|
30
30
|
JSQ=
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2016-
|
32
|
+
date: 2016-08-12 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: librato-metrics
|
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
143
|
version: '0'
|
144
144
|
requirements: []
|
145
145
|
rubyforge_project:
|
146
|
-
rubygems_version: 2.
|
146
|
+
rubygems_version: 2.4.5.1
|
147
147
|
signing_key:
|
148
148
|
specification_version: 4
|
149
149
|
summary: Use Librato Metrics with your rack application
|
metadata.gz.sig
CHANGED