harness 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +3 -0
- data/CHANGELOG.md +5 -0
- data/README.md +33 -6
- data/harness.gemspec +4 -5
- data/lib/harness.rb +0 -2
- data/lib/harness/version.rb +1 -1
- data/test/integration/queues/delayed_job_test.rb +1 -1
- data/test/test_helper.rb +0 -1
- data/test/unit/adapters/stathat_adapter_test.rb +2 -1
- data/test/unit/adapters/statsd_adapter_test.rb +1 -0
- metadata +14 -27
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,4 +1,14 @@
|
|
1
1
|
# Harness
|
2
|
+
[![Build Status](https://secure.travis-ci.org/twinturbo/harness.png?branch=master)][travis]
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/harness.png)][gem]
|
4
|
+
[![Code Climate](https://codeclimate.com/github/twinturbo/harness.png)][codeclimate]
|
5
|
+
[![Dependency Status](https://gemnasium.com/twinturbo/harness.png?travis)][gemnasium]
|
6
|
+
|
7
|
+
[gem]: https://rubygems.org/gems/harness
|
8
|
+
[travis]: http://travis-ci.org/twinturbo/harness
|
9
|
+
[gemnasium]: https://gemnasium.com/twinturbo/harness
|
10
|
+
[codeclimate]: https://codeclimate.com/github/twinturbo/harness
|
11
|
+
[coveralls]: https://coveralls.io/r/twinturbo/harness
|
2
12
|
|
3
13
|
Harness connects measurements coming from `ActiveSupport::Notifications`
|
4
14
|
to external metric tracking services. Counters are stored locally with
|
@@ -47,20 +57,20 @@ end
|
|
47
57
|
|
48
58
|
Add this line to your application's Gemfile:
|
49
59
|
|
50
|
-
```
|
60
|
+
```ruby
|
51
61
|
gem 'harness'
|
52
62
|
```
|
53
63
|
|
54
64
|
And then execute:
|
55
65
|
|
56
|
-
```
|
57
|
-
|
66
|
+
```shell
|
67
|
+
bundle
|
58
68
|
```
|
59
69
|
|
60
70
|
Or install it yourself as:
|
61
71
|
|
62
|
-
```
|
63
|
-
|
72
|
+
```shell
|
73
|
+
gem install harness
|
64
74
|
```
|
65
75
|
|
66
76
|
## Usage
|
@@ -214,7 +224,10 @@ counter = Harness::Counter.new :time => Time.now, :id => 'foo.bar'
|
|
214
224
|
## Configuration
|
215
225
|
|
216
226
|
### Librato
|
227
|
+
|
217
228
|
```ruby
|
229
|
+
require 'harness/adapters/librato_adapter'
|
230
|
+
|
218
231
|
Harness.config.adapter = :librato
|
219
232
|
|
220
233
|
Harness.config.librato.email = 'example@example.com'
|
@@ -231,6 +244,8 @@ must also add `statsd-instrument` to your `Gemfile`. This is a soft
|
|
231
244
|
dependency that is not installed for you.
|
232
245
|
|
233
246
|
```ruby
|
247
|
+
require 'harness/adapters/statsd_adapter'
|
248
|
+
|
234
249
|
Harness.config.adapter = :statsd
|
235
250
|
|
236
251
|
# Harness.config.statsd is a proxy for the StatsD class
|
@@ -247,6 +262,8 @@ Harness.config.statsd.backend = CustomStatsD
|
|
247
262
|
### Stathat
|
248
263
|
|
249
264
|
```ruby
|
265
|
+
require 'harness/adapters/statsd_adapter'
|
266
|
+
|
250
267
|
Harness.config.adapter = :stathat
|
251
268
|
|
252
269
|
Harness.config.stathat.ezkey = 'example@example.com'
|
@@ -256,7 +273,17 @@ Harness.config.stathat.ezkey = 'example@example.com'
|
|
256
273
|
|
257
274
|
Harness will automatically log metrics coming from `ActionPack`,
|
258
275
|
`ActiveRecord`, and `ActionMailer`. `ActiveSupport` instrumentation is
|
259
|
-
disabled by default.
|
276
|
+
disabled by default. First require your adapter in an initializer
|
277
|
+
Harness no longer requires adapters with external dependencies for
|
278
|
+
you. Create a `config/initializers/harness.rb` and require your
|
279
|
+
adapter in it:
|
280
|
+
|
281
|
+
```ruby
|
282
|
+
require 'harness/adapters/statsd_adapter'
|
283
|
+
# other configuration
|
284
|
+
```
|
285
|
+
|
286
|
+
Also, custom integrations are disabled by default.
|
260
287
|
You can turn on instrumentation for specific components like so:
|
261
288
|
|
262
289
|
```ruby
|
data/harness.gemspec
CHANGED
@@ -4,9 +4,9 @@ require File.expand_path('../lib/harness/version', __FILE__)
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.authors = ["twinturbo"]
|
6
6
|
gem.email = ["me@broadcastingadam.com"]
|
7
|
-
gem.description = %q{}
|
7
|
+
gem.description = %q{Log ActiveSupport::Notifications to various services like Librato or StatsD}
|
8
8
|
gem.summary = %q{}
|
9
|
-
gem.homepage = ""
|
9
|
+
gem.homepage = "https://github.com/twinturbo/harness"
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
12
12
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = Harness::VERSION
|
17
17
|
|
18
|
-
gem.add_dependency "activesupport", "
|
18
|
+
gem.add_dependency "activesupport", ">= 3"
|
19
19
|
gem.add_dependency "redis"
|
20
20
|
gem.add_dependency "redis-namespace"
|
21
21
|
|
@@ -25,8 +25,7 @@ Gem::Specification.new do |gem|
|
|
25
25
|
gem.add_development_dependency "sidekiq"
|
26
26
|
gem.add_development_dependency "delayed_job_active_record"
|
27
27
|
gem.add_development_dependency "active_model_serializers"
|
28
|
-
gem.add_development_dependency "rails"
|
28
|
+
gem.add_development_dependency "rails", ">= 3"
|
29
29
|
gem.add_development_dependency "sqlite3"
|
30
|
-
gem.add_development_dependency "minitest"
|
31
30
|
gem.add_development_dependency "statsd-instrument"
|
32
31
|
end
|
data/lib/harness.rb
CHANGED
@@ -95,8 +95,6 @@ require 'harness/queues/synchronous_queue'
|
|
95
95
|
require 'harness/adapters/librato_adapter'
|
96
96
|
require 'harness/adapters/memory_adapter'
|
97
97
|
require 'harness/adapters/null_adapter'
|
98
|
-
require 'harness/adapters/statsd_adapter'
|
99
|
-
require 'harness/adapters/stathat_adapter'
|
100
98
|
|
101
99
|
require 'harness/railtie' if defined?(Rails)
|
102
100
|
|
data/lib/harness/version.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'test_helper'
|
2
|
+
require 'harness/adapters/stathat_adapter'
|
2
3
|
|
3
4
|
class StathatAdapterTest < MiniTest::Unit::TestCase
|
4
5
|
def setup
|
@@ -140,4 +141,4 @@ class StathatAdapterTest < MiniTest::Unit::TestCase
|
|
140
141
|
def token
|
141
142
|
'example@example.com'
|
142
143
|
end
|
143
|
-
end
|
144
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: harness
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,14 +9,14 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-02-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '3'
|
22
22
|
type: :runtime
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '3'
|
30
30
|
- !ruby/object:Gem::Dependency
|
@@ -162,7 +162,7 @@ dependencies:
|
|
162
162
|
requirements:
|
163
163
|
- - ! '>='
|
164
164
|
- !ruby/object:Gem::Version
|
165
|
-
version: '
|
165
|
+
version: '3'
|
166
166
|
type: :development
|
167
167
|
prerelease: false
|
168
168
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -170,7 +170,7 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - ! '>='
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: '
|
173
|
+
version: '3'
|
174
174
|
- !ruby/object:Gem::Dependency
|
175
175
|
name: sqlite3
|
176
176
|
requirement: !ruby/object:Gem::Requirement
|
@@ -187,22 +187,6 @@ dependencies:
|
|
187
187
|
- - ! '>='
|
188
188
|
- !ruby/object:Gem::Version
|
189
189
|
version: '0'
|
190
|
-
- !ruby/object:Gem::Dependency
|
191
|
-
name: minitest
|
192
|
-
requirement: !ruby/object:Gem::Requirement
|
193
|
-
none: false
|
194
|
-
requirements:
|
195
|
-
- - ! '>='
|
196
|
-
- !ruby/object:Gem::Version
|
197
|
-
version: '0'
|
198
|
-
type: :development
|
199
|
-
prerelease: false
|
200
|
-
version_requirements: !ruby/object:Gem::Requirement
|
201
|
-
none: false
|
202
|
-
requirements:
|
203
|
-
- - ! '>='
|
204
|
-
- !ruby/object:Gem::Version
|
205
|
-
version: '0'
|
206
190
|
- !ruby/object:Gem::Dependency
|
207
191
|
name: statsd-instrument
|
208
192
|
requirement: !ruby/object:Gem::Requirement
|
@@ -219,7 +203,8 @@ dependencies:
|
|
219
203
|
- - ! '>='
|
220
204
|
- !ruby/object:Gem::Version
|
221
205
|
version: '0'
|
222
|
-
description:
|
206
|
+
description: Log ActiveSupport::Notifications to various services like Librato or
|
207
|
+
StatsD
|
223
208
|
email:
|
224
209
|
- me@broadcastingadam.com
|
225
210
|
executables: []
|
@@ -227,6 +212,8 @@ extensions: []
|
|
227
212
|
extra_rdoc_files: []
|
228
213
|
files:
|
229
214
|
- .gitignore
|
215
|
+
- .travis.yml
|
216
|
+
- CHANGELOG.md
|
230
217
|
- Gemfile
|
231
218
|
- LICENSE
|
232
219
|
- README.md
|
@@ -281,7 +268,7 @@ files:
|
|
281
268
|
- test/unit/gauge_test.rb
|
282
269
|
- test/unit/harness_test.rb
|
283
270
|
- test/unit/measurement_test.rb
|
284
|
-
homepage:
|
271
|
+
homepage: https://github.com/twinturbo/harness
|
285
272
|
licenses: []
|
286
273
|
post_install_message:
|
287
274
|
rdoc_options: []
|
@@ -295,7 +282,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
295
282
|
version: '0'
|
296
283
|
segments:
|
297
284
|
- 0
|
298
|
-
hash: -
|
285
|
+
hash: -1797502942672094677
|
299
286
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
300
287
|
none: false
|
301
288
|
requirements:
|
@@ -304,10 +291,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
304
291
|
version: '0'
|
305
292
|
segments:
|
306
293
|
- 0
|
307
|
-
hash: -
|
294
|
+
hash: -1797502942672094677
|
308
295
|
requirements: []
|
309
296
|
rubyforge_project:
|
310
|
-
rubygems_version: 1.8.
|
297
|
+
rubygems_version: 1.8.25
|
311
298
|
signing_key:
|
312
299
|
specification_version: 3
|
313
300
|
summary: ''
|