appsignal 2.10.9.beta.1-java → 2.10.9-java

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: 7bda1f3cc0e348c0eb1225daa9037738c1ed172160d841c0c5a2b94177aae323
4
- data.tar.gz: 1f2547a66a52cfb860e7edee2bf687ccea4e01bd84f110fade1ca2e54a856a8e
3
+ metadata.gz: 471917b7c9708ab3978364fac0ae7e1c87a61ba0ec596e3ca5b6227784fa6779
4
+ data.tar.gz: 360aaf2f25e55c285b708cd8f379f6305bd04a4094cdb95d9cb64e0f2d772483
5
5
  SHA512:
6
- metadata.gz: c33b49887af22ef64a4810046e5aadb24d1b8e4e1aad6b885a86d08b93ac4c4f8045da29b0e2ffea2c2e06feece84d82fde28d70309f145557926684985177b4
7
- data.tar.gz: 682e932a33c5b9945297519b6a9404670a1196a796303f4cdc7e7a48fd908bae580302a22aa926f491133d75317c4bc4cd7acb250004907789fa3a2bfd6f8f20
6
+ metadata.gz: 4f19363c45bb5a089f1ce255b84b8282be1cee8ab60d9276212e2ee5849f3e1840d0f5ab33506416eb7d1e4ff4b09d5d1119d8a1cd0ba11398d9d23318099aba
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: java
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
@@ -393,7 +393,7 @@ metadata:
393
393
  documentation_uri: https://docs.appsignal.com/ruby/
394
394
  homepage_uri: https://docs.appsignal.com/ruby/
395
395
  source_code_uri: https://github.com/appsignal/appsignal-ruby
396
- post_install_message:
396
+ post_install_message:
397
397
  rdoc_options: []
398
398
  require_paths:
399
399
  - lib
@@ -405,12 +405,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
405
405
  version: '1.9'
406
406
  required_rubygems_version: !ruby/object:Gem::Requirement
407
407
  requirements:
408
- - - ">"
408
+ - - ">="
409
409
  - !ruby/object:Gem::Version
410
- version: 1.3.1
410
+ version: '0'
411
411
  requirements: []
412
- rubygems_version: 3.1.2
413
- signing_key:
412
+ rubygems_version: 3.1.4
413
+ signing_key:
414
414
  specification_version: 4
415
415
  summary: Logs performance and exception data from your app to appsignal.com
416
416
  test_files: