airbrake-ruby 4.11.1 → 4.12.0

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: 6b9d78ba8789ccfa27f139a5ad0fef6b544da9bde4239dfda22cc543493bdb45
4
- data.tar.gz: c32c7e64425037221491c64de8e22d548815929ec6e3a0289aad3c74f8ffedc7
3
+ metadata.gz: 8c5e41d6b33c6a201ef67d32e32e69bbef6e560c1af80dc19ae8f4192d6b84fd
4
+ data.tar.gz: 34e30b5ce530edc18c512ba0be5392a2c53cdee68ec23eb43174e9690715f821
5
5
  SHA512:
6
- metadata.gz: 711d058e48af32390e7b92243171014122b5e454cea35afd19ca72e5fe39d04b919f0cbc95dfdf23685a3114cac14430310eb5a0c785c263d85a52ca26bab861
7
- data.tar.gz: 300176c0bab2a6ddcb4b3453069be19ef5a477021ca10f68256edabc97c9d0d15b3b4a5659f2676e53071f89229b59c90ac6d0f1016d953342af8d9fc8b27581
6
+ metadata.gz: '0081a23db3f3ff08f56382e97a67685a7c28eb81c5c93963a440a5f216ddf322ffaf8dae6be14a1394edc079dbd1644511f817693a14eebb3e097243f03f74c9'
7
+ data.tar.gz: c9c58c197046e16f7706cddbfb4caab70837f03b457418ff22f756499efe6bd98762eca8547a9e716af9d04e20c53a4440a9ca83affc7c1713623d3a191cb560
@@ -101,6 +101,12 @@ module Airbrake
101
101
  # @since v4.6.0
102
102
  attr_accessor :query_stats
103
103
 
104
+ # @return [Boolean] true if the library should send job/queue/worker stats
105
+ # to Airbrake, false otherwise
106
+ # @api public
107
+ # @since v4.12.0
108
+ attr_accessor :job_stats
109
+
104
110
  class << self
105
111
  # @return [Config]
106
112
  attr_writer :instance
@@ -139,6 +145,7 @@ module Airbrake
139
145
  self.performance_stats = true
140
146
  self.performance_stats_flush_period = 15
141
147
  self.query_stats = true
148
+ self.job_stats = true
142
149
 
143
150
  merge(user_config)
144
151
  end
@@ -213,6 +220,8 @@ module Airbrake
213
220
  promise.reject("The Performance Stats feature is disabled")
214
221
  elsif resource.is_a?(Airbrake::Query) && !query_stats
215
222
  promise.reject("The Query Stats feature is disabled")
223
+ elsif resource.is_a?(Airbrake::Queue) && !job_stats
224
+ promise.reject("The Job Stats feature is disabled")
216
225
  else
217
226
  promise
218
227
  end
@@ -2,5 +2,5 @@
2
2
  # More information: http://semver.org/
3
3
  module Airbrake
4
4
  # @return [String] the library version
5
- AIRBRAKE_RUBY_VERSION = '4.11.1'.freeze
5
+ AIRBRAKE_RUBY_VERSION = '4.12.0'.freeze
6
6
  end
@@ -22,6 +22,7 @@ RSpec.describe Airbrake::Config do
22
22
  its(:performance_stats) { is_expected.to eq(true) }
23
23
  its(:performance_stats_flush_period) { is_expected.to eq(15) }
24
24
  its(:query_stats) { is_expected.to eq(true) }
25
+ its(:job_stats) { is_expected.to eq(true) }
25
26
 
26
27
  describe "#new" do
27
28
  context "when user config is passed" do
@@ -146,5 +147,20 @@ RSpec.describe Airbrake::Config do
146
147
  )
147
148
  end
148
149
  end
150
+
151
+ context "when job stats are disabled" do
152
+ before { subject.job_stats = false }
153
+
154
+ let(:resource) do
155
+ Airbrake::Queue.new(queue: 'foo_queue', error_count: 0, timing: 1)
156
+ end
157
+
158
+ it "returns a rejected promise" do
159
+ promise = subject.check_performance_options(resource)
160
+ expect(promise.value).to eq(
161
+ 'error' => "The Job Stats feature is disabled",
162
+ )
163
+ end
164
+ end
149
165
  end
150
166
  end
@@ -16,6 +16,7 @@ RSpec.describe Airbrake::PerformanceNotifier do
16
16
  performance_stats: true,
17
17
  performance_stats_flush_period: 0,
18
18
  query_stats: true,
19
+ job_stats: true,
19
20
  )
20
21
  end
21
22
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airbrake-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.11.1
4
+ version: 4.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Airbrake Technologies, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-20 00:00:00.000000000 Z
11
+ date: 2020-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbtree3