appsignal 2.10.9.beta.1 → 2.10.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: feb0fea54454760dda53b315801abe633ff93020494901b2d1259dff9d2785cd
4
- data.tar.gz: 1f2547a66a52cfb860e7edee2bf687ccea4e01bd84f110fade1ca2e54a856a8e
3
+ metadata.gz: cfa76c78bc879ac3d9a5d079b41c79ddb2c51764167af571239970292551d3f2
4
+ data.tar.gz: 360aaf2f25e55c285b708cd8f379f6305bd04a4094cdb95d9cb64e0f2d772483
5
5
  SHA512:
6
- metadata.gz: 6ea79ec6f7bff12717cb54c9a7541c3b9dea45ab51dc369c62db9e67b878243f7b20ccc74e177910e6dd6d2e2c4d7ae09dcab3a71ac1298e4c3b6cfe92d5a5af
7
- data.tar.gz: 682e932a33c5b9945297519b6a9404670a1196a796303f4cdc7e7a48fd908bae580302a22aa926f491133d75317c4bc4cd7acb250004907789fa3a2bfd6f8f20
6
+ metadata.gz: 7f8fbf38ae6cc5dabd63d9ecea0f5995ac5fab1bda42cab457b1b69ca834fdce746a40f7fa75f162b2c749bc4cce3e17a1b69cbc9a991a588ccac9b7de11f635
7
+ data.tar.gz: 8a61386562b1fd28dfa9b90493729a5392b448ad281527caaa71401a2b98fd10018e2680e920c10127dafe94da23c08ace32d681659586ab3029239bf97ae9d0
@@ -1,8 +1,10 @@
1
1
  # Changelog
2
2
 
3
3
  # 2.10.9
4
- - Use http proxy if configured when downloading agent
5
- - Clear event details cache every 48 hours
4
+ - Use http proxy if configured when downloading agent. PR #606
5
+ - Clear event details cache every 48 hours.
6
+ Commit eb5e899db69fcd7cfa221567bfd6ac04f2654c9c
7
+ - Add support for Resque ActiveJob queue time reporting. PR #616
6
8
 
7
9
  ## 2.10.8
8
10
  - Fix failed checksum error log. PR #609
@@ -14,12 +14,18 @@ module Appsignal
14
14
  Appsignal.config[:filter_parameters]
15
15
  )
16
16
 
17
+ queue_start =
18
+ if job.respond_to?(:enqueued_at) && job.enqueued_at
19
+ Time.parse(job.enqueued_at).utc
20
+ end
21
+
17
22
  Appsignal.monitor_single_transaction(
18
23
  "perform_job.resque",
19
- :class => job.class.to_s,
20
- :method => "perform",
21
- :params => params,
22
- :metadata => {
24
+ :class => job.class.to_s,
25
+ :method => "perform",
26
+ :params => params,
27
+ :queue_start => queue_start,
28
+ :metadata => {
23
29
  :id => job.job_id,
24
30
  :queue => job.queue_name
25
31
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Appsignal
4
- VERSION = "2.10.9.beta.1".freeze
4
+ VERSION = "2.10.9".freeze
5
5
  end
@@ -1,21 +1,18 @@
1
- if DependencyHelper.resque_present? && DependencyHelper.active_job_present?
1
+ if DependencyHelper.active_job_present?
2
2
  require "active_job"
3
+ require File.expand_path("lib/appsignal/integrations/resque_active_job.rb")
4
+
5
+ class TestActiveJob < ActiveJob::Base
6
+ include Appsignal::Integrations::ResqueActiveJobPlugin
7
+
8
+ def perform(_)
9
+ end
10
+ end
3
11
 
4
12
  describe Appsignal::Integrations::ResqueActiveJobPlugin do
5
- let(:file) { File.expand_path("lib/appsignal/integrations/resque_active_job.rb") }
6
13
  let(:args) { "argument" }
7
14
  let(:job) { TestActiveJob.new(args) }
8
- before do
9
- load file
10
- start_agent
11
-
12
- class TestActiveJob < ActiveJob::Base
13
- include Appsignal::Integrations::ResqueActiveJobPlugin
14
-
15
- def perform(_)
16
- end
17
- end
18
- end
15
+ before { start_agent }
19
16
 
20
17
  def perform
21
18
  keep_transactions do
@@ -141,5 +138,50 @@ if DependencyHelper.resque_present? && DependencyHelper.active_job_present?
141
138
  end
142
139
  end
143
140
  end
141
+
142
+ context "without queue time" do
143
+ it "does not add queue time to transaction" do
144
+ # TODO: Not available in transaction.to_h yet.
145
+ # https://github.com/appsignal/appsignal-agent/issues/293
146
+ expect(Appsignal).to receive(:monitor_single_transaction).with(
147
+ "perform_job.resque",
148
+ a_hash_including(:queue_start => nil)
149
+ ).and_call_original
150
+
151
+ perform
152
+ expect(last_transaction.to_h).to include(
153
+ "namespace" => Appsignal::Transaction::BACKGROUND_JOB,
154
+ "action" => "TestActiveJob#perform",
155
+ "events" => [
156
+ hash_including("name" => "perform_job.resque")
157
+ ]
158
+ )
159
+ end
160
+ end
161
+
162
+ if DependencyHelper.rails6_present?
163
+ context "with queue time" do
164
+ it "adds queue time to transction" do
165
+ queue_start = "2017-01-01 10:01:00UTC"
166
+ queue_start_time = Time.parse(queue_start)
167
+ # TODO: Not available in transaction.to_h yet.
168
+ # https://github.com/appsignal/appsignal-agent/issues/293
169
+ expect(Appsignal).to receive(:monitor_single_transaction).with(
170
+ "perform_job.resque",
171
+ a_hash_including(:queue_start => queue_start_time)
172
+ ).and_call_original
173
+ job.enqueued_at = queue_start
174
+
175
+ perform
176
+ expect(last_transaction.to_h).to include(
177
+ "namespace" => Appsignal::Transaction::BACKGROUND_JOB,
178
+ "action" => "TestActiveJob#perform",
179
+ "events" => [
180
+ hash_including("name" => "perform_job.resque")
181
+ ]
182
+ )
183
+ end
184
+ end
185
+ end
144
186
  end
145
187
  end
@@ -9,6 +9,11 @@ module DependencyHelper
9
9
  dependency_present? "rails"
10
10
  end
11
11
 
12
+ def rails6_present?
13
+ rails_present? &&
14
+ Gem.loaded_specs["rails"].version >= Gem::Version.new("6.0.0")
15
+ end
16
+
12
17
  def sequel_present?
13
18
  dependency_present? "sequel"
14
19
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appsignal
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.9.beta.1
4
+ version: 2.10.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Beekman
8
8
  - Thijs Cadier
9
9
  - Tom de Bruijn
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-06-17 00:00:00.000000000 Z
13
+ date: 2020-06-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack
@@ -379,7 +379,7 @@ metadata:
379
379
  documentation_uri: https://docs.appsignal.com/ruby/
380
380
  homepage_uri: https://docs.appsignal.com/ruby/
381
381
  source_code_uri: https://github.com/appsignal/appsignal-ruby
382
- post_install_message:
382
+ post_install_message:
383
383
  rdoc_options: []
384
384
  require_paths:
385
385
  - lib
@@ -391,12 +391,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
391
391
  version: '1.9'
392
392
  required_rubygems_version: !ruby/object:Gem::Requirement
393
393
  requirements:
394
- - - ">"
394
+ - - ">="
395
395
  - !ruby/object:Gem::Version
396
- version: 1.3.1
396
+ version: '0'
397
397
  requirements: []
398
- rubygems_version: 3.1.2
399
- signing_key:
398
+ rubygems_version: 3.1.4
399
+ signing_key:
400
400
  specification_version: 4
401
401
  summary: Logs performance and exception data from your app to appsignal.com
402
402
  test_files: