airbrake-ruby 4.11.1 → 4.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/airbrake-ruby/config.rb +9 -0
- data/lib/airbrake-ruby/version.rb +1 -1
- data/spec/config_spec.rb +16 -0
- data/spec/performance_notifier_spec.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c5e41d6b33c6a201ef67d32e32e69bbef6e560c1af80dc19ae8f4192d6b84fd
|
4
|
+
data.tar.gz: 34e30b5ce530edc18c512ba0be5392a2c53cdee68ec23eb43174e9690715f821
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0081a23db3f3ff08f56382e97a67685a7c28eb81c5c93963a440a5f216ddf322ffaf8dae6be14a1394edc079dbd1644511f817693a14eebb3e097243f03f74c9'
|
7
|
+
data.tar.gz: c9c58c197046e16f7706cddbfb4caab70837f03b457418ff22f756499efe6bd98762eca8547a9e716af9d04e20c53a4440a9ca83affc7c1713623d3a191cb560
|
data/lib/airbrake-ruby/config.rb
CHANGED
@@ -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
|
data/spec/config_spec.rb
CHANGED
@@ -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
|
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.
|
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:
|
11
|
+
date: 2020-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbtree3
|