seismograph 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +10 -0
- data/README.md +6 -0
- data/lib/seismograph/configuration.rb +15 -14
- data/lib/seismograph/gateway.rb +4 -2
- data/lib/seismograph/log.rb +1 -0
- data/lib/seismograph/testing.rb +3 -0
- data/lib/seismograph/version.rb +1 -1
- data/seismograph.gemspec +1 -1
- metadata +9 -8
- data/circle.yml +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 42b2fcc5c185d2d98e73edf75e16d102e0959b2e22b9ed88476b7c29b3e95579
|
4
|
+
data.tar.gz: 71642985d3c4f4e1a04afe83543c4fb22700f1028234e7df666fc8d9718a38e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffd37f05c8efe0a596f8d294e00519396afeec312fbe572bdf858aef1c52e95f4fbf9f7a0a0d2f1cc01d772e8a44c5d605bdf99d20159eca1c5ecf6ad018d172
|
7
|
+
data.tar.gz: 5b0ba4d60b8cf53ff1e5e5d816accd90bf46e8fca0f8ab32248076dd09bd1390588de60a095c14e28c9a1192f6cc013433a7f7d50dd9498c17b4c05974bc55fe
|
data/README.md
CHANGED
@@ -1,22 +1,23 @@
|
|
1
1
|
module Seismograph
|
2
2
|
class Configuration
|
3
|
-
|
4
|
-
attr_writer :statsd_port
|
5
|
-
attr_writer :app_name
|
6
|
-
attr_writer :env
|
3
|
+
attr_accessor :enabled
|
7
4
|
|
8
|
-
def
|
9
|
-
|
5
|
+
def initialize
|
6
|
+
self.enabled = true
|
10
7
|
end
|
11
8
|
|
12
|
-
def
|
13
|
-
@
|
9
|
+
def app_name
|
10
|
+
@app_name || fail('No app_name configured')
|
14
11
|
end
|
15
12
|
|
16
13
|
def app_name=(name)
|
17
14
|
@app_name = name
|
18
15
|
end
|
19
16
|
|
17
|
+
def env
|
18
|
+
@env || ENV['RAILS_ENV'] || ENV['RACK_ENV']
|
19
|
+
end
|
20
|
+
|
20
21
|
def env=(env)
|
21
22
|
@env = env
|
22
23
|
end
|
@@ -25,16 +26,16 @@ module Seismograph
|
|
25
26
|
@statsd_host || fail('No statsd_host configured')
|
26
27
|
end
|
27
28
|
|
28
|
-
def
|
29
|
-
@
|
29
|
+
def statsd_host=(host)
|
30
|
+
@statsd_host = host
|
30
31
|
end
|
31
32
|
|
32
|
-
def
|
33
|
-
@
|
33
|
+
def statsd_port
|
34
|
+
@statsd_port || fail('No statsd_port configured')
|
34
35
|
end
|
35
36
|
|
36
|
-
def
|
37
|
-
@
|
37
|
+
def statsd_port=(port)
|
38
|
+
@statsd_port = port.to_s
|
38
39
|
end
|
39
40
|
end
|
40
41
|
end
|
data/lib/seismograph/gateway.rb
CHANGED
@@ -2,11 +2,13 @@ require 'statsd'
|
|
2
2
|
|
3
3
|
module Seismograph
|
4
4
|
module Gateway
|
5
|
+
GATEWAY_METHODS = [:histogram, :increment, :decrement, :time, :timing, :event, :gauge].freeze
|
6
|
+
|
5
7
|
class << self
|
6
|
-
|
8
|
+
GATEWAY_METHODS.each do |method|
|
7
9
|
class_eval <<-RUBY, __FILE__, __LINE__+1
|
8
10
|
def #{method}(*a, &b)
|
9
|
-
client.send(:#{method}, *a, &b)
|
11
|
+
client.send(:#{method}, *a, &b) if Seismograph.config.enabled
|
10
12
|
end
|
11
13
|
RUBY
|
12
14
|
end
|
data/lib/seismograph/log.rb
CHANGED
data/lib/seismograph/version.rb
CHANGED
data/seismograph.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_runtime_dependency 'dogstatsd-ruby', '~> 1.5'
|
22
22
|
|
23
23
|
spec.add_development_dependency 'pry-nav'
|
24
|
-
spec.add_development_dependency 'bundler'
|
24
|
+
spec.add_development_dependency 'bundler'
|
25
25
|
spec.add_development_dependency 'rake', '~> 10.0'
|
26
26
|
spec.add_development_dependency 'rspec', '~> 3.2'
|
27
27
|
spec.add_development_dependency 'rspec-its', '~> 1.2'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seismograph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Croft
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-03-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dogstatsd-ruby
|
@@ -43,16 +43,16 @@ dependencies:
|
|
43
43
|
name: bundler
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- - "
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
48
|
+
version: '0'
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- - "
|
53
|
+
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
55
|
+
version: '0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: rake
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -103,19 +103,20 @@ executables: []
|
|
103
103
|
extensions: []
|
104
104
|
extra_rdoc_files: []
|
105
105
|
files:
|
106
|
+
- ".circleci/config.yml"
|
106
107
|
- ".gitignore"
|
107
108
|
- ".rspec"
|
108
109
|
- Gemfile
|
109
110
|
- LICENSE.txt
|
110
111
|
- README.md
|
111
112
|
- Rakefile
|
112
|
-
- circle.yml
|
113
113
|
- lib/seismograph.rb
|
114
114
|
- lib/seismograph/configuration.rb
|
115
115
|
- lib/seismograph/gateway.rb
|
116
116
|
- lib/seismograph/log.rb
|
117
117
|
- lib/seismograph/parameterize.rb
|
118
118
|
- lib/seismograph/sensor.rb
|
119
|
+
- lib/seismograph/testing.rb
|
119
120
|
- lib/seismograph/version.rb
|
120
121
|
- seismograph.gemspec
|
121
122
|
homepage: https://github.com/kapost/seismograph
|
@@ -138,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
139
|
version: '0'
|
139
140
|
requirements: []
|
140
141
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
142
|
+
rubygems_version: 2.7.6
|
142
143
|
signing_key:
|
143
144
|
specification_version: 4
|
144
145
|
summary: Helper library to report stats and events to datadoghq
|
data/circle.yml
DELETED