sapience 2.10 → 2.11

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
2
  SHA256:
3
- metadata.gz: b8328fe94f351331e7594422f677311ba6363758a907930a25d21d044b26546c
4
- data.tar.gz: a3504915777fc5ce3faf0ea8b8e310269b8cba1d0c6b9ad7013bec43884a4046
3
+ metadata.gz: 4dea67688e4da16e54b354ef95c3307c40b4c48a7a9c731b036a759301993bad
4
+ data.tar.gz: e95f42b7e1b564b96436119394c5cf36bfe764e151edc27f3bdd71571d373ff3
5
5
  SHA512:
6
- metadata.gz: ffcd578e958d88c52a12ebe6926478d7fec5077dc4d5d328a14e0bb088337758f3e81ab40e1a996211cac07d64cd6b66e73a1cf51b23ebb7eb7a953802146308
7
- data.tar.gz: f88677aa78333f3b804c50c9b3cad868d2d37fe71dbd994ba165943f657f40ba78d0e9a620c8b2b23aea98a82dd2b39fcfe1c781bdae8ca4470d74675fce231e
6
+ metadata.gz: 9d44242c65762e0696ff3b34256d2ee67cee441c1a957efb988ecebaa6abd340ba2e02e1fbd5168973262e689333b7bbc4e4fd5835bc9a5472b22fbb2990c15d
7
+ data.tar.gz: b803898eee7e30eedfcf704d9befc942e518e53da773fe699888d6c4cdfe79402ce4bdb7f9bbfdb5f1a14b2b78cc0d7101e658c32fe1da01c181c50a80f24fc0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## v2.11
2
+ - Add config option to enable/disable metrics from ActionController
3
+
1
4
  ## v2.10
2
5
  - Fix spec for Ruby 2.4.1
3
6
  - Bump version to 2.10 in order to properly highlight more significant change
data/README.md CHANGED
@@ -22,6 +22,15 @@ Add the gem:
22
22
  gem "sapience", require: "sapience/rails"
23
23
  ```
24
24
 
25
+ The rails integration has the following configuration options:
26
+
27
+ | Option | Description | Values | Default |
28
+ | --------------------- | ---------- | ------ | ----- |
29
+ | silent_rails | less noisy rails logs | `boolean` | `true` |
30
+ | silent_rack | suppress "Request Started..." log message from rack | `boolean` | `true` |
31
+ | silent_active_record | emit metrics from ActiveRecord | `boolean` | `true` |
32
+ | rails_ac_metrics | emit metrics from ActionController | `boolean` | `true` |
33
+
25
34
  ### Sinatra
26
35
  Add the gem:
27
36
 
@@ -156,6 +165,10 @@ Or if you, like us, have many projects that use the same configuration you can c
156
165
  default:
157
166
  app_name: My Application
158
167
  log_level: debug
168
+ silent_active_record: true
169
+ silent_rails: true
170
+ silent_rack: true
171
+ rails_ac_metrics: true
159
172
  appenders:
160
173
  - stream:
161
174
  io: STDOUT
@@ -8,7 +8,8 @@ module Sapience
8
8
  attr_reader :default_level, :backtrace_level, :backtrace_level_index
9
9
  attr_writer :host
10
10
  attr_accessor :app_name, :ap_options, :appenders, :log_executor, :filter_parameters,
11
- :metrics, :error_handler, :silent_active_record, :silent_rails, :silent_rack
11
+ :metrics, :error_handler, :silent_active_record, :silent_rails, :silent_rack,
12
+ :rails_ac_metrics
12
13
 
13
14
  SUPPORTED_EXECUTORS = %i(single_thread_executor immediate_executor).freeze
14
15
  DEFAULT = {
@@ -23,6 +24,7 @@ module Sapience
23
24
  silent_active_record: false,
24
25
  silent_rails: false,
25
26
  silent_rack: false,
27
+ rails_ac_metrics: true,
26
28
  }.freeze
27
29
 
28
30
  # Initial default Level for all new instances of Sapience::Logger
@@ -44,6 +46,7 @@ module Sapience
44
46
  self.silent_active_record = @options[:silent_active_record]
45
47
  self.silent_rails = @options[:silent_rails]
46
48
  self.silent_rack = @options[:silent_rack]
49
+ self.rails_ac_metrics = @options[:rails_ac_metrics]
47
50
  end
48
51
 
49
52
  # Sets the global default log level
@@ -83,7 +83,7 @@ module Sapience
83
83
  end
84
84
  Sapience::Extensions::ActionView::LogSubscriber.attach_to :action_view
85
85
  # Sapience::Extensions::ActiveJob::LogSubscriber.attach_to :active_job
86
- Sapience::Extensions::ActionController::Notifications.use
86
+ Sapience::Extensions::ActionController::Notifications.use if Sapience.config.rails_ac_metrics
87
87
  Sapience::Extensions::ActiveJob::Notifications.use if defined?(ActiveJob)
88
88
  end
89
89
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Sapience
3
- VERSION = "2.10"
3
+ VERSION = "2.11"
4
4
  end
data/sapience.gemspec CHANGED
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
37
37
  spec.add_development_dependency "memory_profiler"
38
38
  spec.add_development_dependency "pry-nav"
39
39
  spec.add_development_dependency "rails", "~> 5.0.0.1"
40
- spec.add_development_dependency "rake", "~> 10.0"
40
+ spec.add_development_dependency "rake"
41
41
  spec.add_development_dependency "reevoocop"
42
42
  spec.add_development_dependency "rspec", "~> 3.0"
43
43
  spec.add_development_dependency "rspec-its"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sapience
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.10'
4
+ version: '2.11'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Henriksson
@@ -183,16 +183,16 @@ dependencies:
183
183
  name: rake
184
184
  requirement: !ruby/object:Gem::Requirement
185
185
  requirements:
186
- - - "~>"
186
+ - - ">="
187
187
  - !ruby/object:Gem::Version
188
- version: '10.0'
188
+ version: '0'
189
189
  type: :development
190
190
  prerelease: false
191
191
  version_requirements: !ruby/object:Gem::Requirement
192
192
  requirements:
193
- - - "~>"
193
+ - - ">="
194
194
  - !ruby/object:Gem::Version
195
- version: '10.0'
195
+ version: '0'
196
196
  - !ruby/object:Gem::Dependency
197
197
  name: reevoocop
198
198
  requirement: !ruby/object:Gem::Requirement