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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 304fac66cef6e2f2769cc51ea065b2bba6951c9b
4
- data.tar.gz: 90d0508529ca3bc5c677a2ff83f5fc271af82879
2
+ SHA256:
3
+ metadata.gz: 42b2fcc5c185d2d98e73edf75e16d102e0959b2e22b9ed88476b7c29b3e95579
4
+ data.tar.gz: 71642985d3c4f4e1a04afe83543c4fb22700f1028234e7df666fc8d9718a38e0
5
5
  SHA512:
6
- metadata.gz: b9af1485de248004538db1b27091621538d0599894022210d4c92440eb9be65895d6cdf7ae431b98569240900146c795c0481c5b21c89d31ca3698bca48abd7a
7
- data.tar.gz: 12e55c9351e94d1c5d3e37a902d17c46b085a548e56d231d35976844bff004cdf75742509cee2065553280afe456f98752492284dca80543dbf262ffa538753b
6
+ metadata.gz: ffd37f05c8efe0a596f8d294e00519396afeec312fbe572bdf858aef1c52e95f4fbf9f7a0a0d2f1cc01d772e8a44c5d605bdf99d20159eca1c5ecf6ad018d172
7
+ data.tar.gz: 5b0ba4d60b8cf53ff1e5e5d816accd90bf46e8fca0f8ab32248076dd09bd1390588de60a095c14e28c9a1192f6cc013433a7f7d50dd9498c17b4c05974bc55fe
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ jobs:
3
+ build:
4
+ working_directory: ~/seismograph
5
+ docker:
6
+ - image: kapost/ruby:2.4.3-node-6.11.5
7
+ steps:
8
+ - checkout
9
+ - run: bundle install
10
+ - run: bundle exec rspec --format documentation --color spec
data/README.md CHANGED
@@ -138,6 +138,12 @@ task :deploy do
138
138
  end
139
139
  ```
140
140
 
141
+ ### Test Environment:
142
+
143
+ To disable seismograph in your test environment, include this file in your test helper:
144
+
145
+ `require 'seismograph/testing'`
146
+
141
147
  ## Contributing
142
148
 
143
149
  1. Fork it
@@ -1,22 +1,23 @@
1
1
  module Seismograph
2
2
  class Configuration
3
- attr_writer :statsd_host
4
- attr_writer :statsd_port
5
- attr_writer :app_name
6
- attr_writer :env
3
+ attr_accessor :enabled
7
4
 
8
- def statsd_host=(host)
9
- @statsd_host = host
5
+ def initialize
6
+ self.enabled = true
10
7
  end
11
8
 
12
- def statsd_port=(port)
13
- @statsd_port = port.to_s
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 statsd_port
29
- @statsd_port || fail('No statsd_port configured')
29
+ def statsd_host=(host)
30
+ @statsd_host = host
30
31
  end
31
32
 
32
- def app_name
33
- @app_name || fail('No app_name configured')
33
+ def statsd_port
34
+ @statsd_port || fail('No statsd_port configured')
34
35
  end
35
36
 
36
- def env
37
- @env || ENV['RAILS_ENV'] || ENV['RACK_ENV']
37
+ def statsd_port=(port)
38
+ @statsd_port = port.to_s
38
39
  end
39
40
  end
40
41
  end
@@ -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
- [:histogram, :increment, :decrement, :time, :timing, :event, :gauge].each do |method|
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
@@ -1,3 +1,4 @@
1
+ require 'seismograph/gateway'
1
2
  require 'seismograph/parameterize'
2
3
 
3
4
  module Seismograph
@@ -0,0 +1,3 @@
1
+ require 'seismograph'
2
+
3
+ Seismograph.config.enabled = false
@@ -1,3 +1,3 @@
1
1
  module Seismograph
2
- VERSION = '0.3.3'
2
+ VERSION = '0.3.4'
3
3
  end
@@ -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', '~> 1.11.0'
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.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: 2016-03-15 00:00:00.000000000 Z
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: 1.11.0
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: 1.11.0
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.5.1
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
@@ -1,3 +0,0 @@
1
- dependencies:
2
- pre:
3
- - gem install bundler -v 1.11.2