appsignal 0.8.1.beta.0 → 0.8.1.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/appsignal/transaction.rb +6 -3
- data/lib/appsignal/transaction/formatter.rb +2 -4
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/transaction/formatter_spec.rb +12 -1
- data/spec/lib/appsignal/transaction_spec.rb +1 -1
- data/spec/support/helpers/transaction_helpers.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDVkNjBlODY5OTYzNTYwOWFiNzkzYjY3NzY1NTJhNjZkYmNmNDVmOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OWZjNGJiYjY2MzAwNDE2ZDk4NjY2MGU5OWJlMDJjODExNDRhMTAxNw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MDE4N2EyYjE0MzE5M2Y3NWI1NTk0N2YxMTM0YmMzMzk3ZjY2Mzc4MTRmZTEy
|
10
|
+
NWMyM2E1ZjYwZmU3OWJlNjQwYTE5OTU2MGI4NmQ0MTA0YTExNTQ4YzJlZmQy
|
11
|
+
ZmI1NGY0M2JiNjU3ODA0OGNmYjU3NmEwZjkzMTAwYjgwMzc3Yjg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Njc3ZmU3N2Y1Yjc2MWQzZDdmYzBmYjI0NmM5NzA3OGIzNTdkM2Y2ZGZjOTM3
|
14
|
+
MWYzMjJlYmYzMjAwMTc2OTc4MWYyMjQ0Y2RiNzg4ZGQwZDYyMTk0NzhiMTY0
|
15
|
+
MzYwMTE0OWM3MWE4NGIyNDAwYzRjMzJiN2NkYzE1ZWVkZDczNzA=
|
@@ -124,17 +124,20 @@ module Appsignal
|
|
124
124
|
end
|
125
125
|
|
126
126
|
def set_background_queue_start
|
127
|
-
|
128
|
-
|
127
|
+
queue_start = process_action_event.payload[:queue_start]
|
128
|
+
return unless queue_start
|
129
|
+
Appsignal.logger.debug("Setting background queue start: #{queue_start}")
|
130
|
+
@queue_start = queue_start.to_f
|
129
131
|
end
|
130
132
|
|
131
133
|
def set_http_queue_start
|
132
134
|
return unless env
|
133
135
|
env_var = env['HTTP_X_QUEUE_START'] || env['HTTP_X_REQUEST_START']
|
134
136
|
if env_var
|
137
|
+
Appsignal.logger.debug("Setting http queue start: #{env_var}")
|
135
138
|
value = env_var.tr('^0-9', '')
|
136
139
|
unless value.empty?
|
137
|
-
@queue_start = value.to_f /
|
140
|
+
@queue_start = value.to_f / 1000
|
138
141
|
end
|
139
142
|
end
|
140
143
|
end
|
@@ -49,10 +49,8 @@ module Appsignal
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def add_queue_duration_to_hash!
|
52
|
-
|
53
|
-
|
54
|
-
hash[:log_entry][:queue_duration] = hash[:log_entry][:time] - start
|
55
|
-
end
|
52
|
+
return unless queue_start && queue_start > 0
|
53
|
+
hash[:log_entry][:queue_duration] = hash[:log_entry][:time] - queue_start
|
56
54
|
end
|
57
55
|
|
58
56
|
def add_tags_to_hash!
|
data/lib/appsignal/version.rb
CHANGED
@@ -114,7 +114,8 @@ describe Appsignal::Transaction::Formatter do
|
|
114
114
|
end
|
115
115
|
|
116
116
|
context "with a background request" do
|
117
|
-
let(:
|
117
|
+
let(:payload) { create_background_payload }
|
118
|
+
let(:transaction) { background_job_transaction({}, payload) }
|
118
119
|
before { transaction.truncate! }
|
119
120
|
|
120
121
|
its(:keys) { should =~ [:request_id, :log_entry, :failed] }
|
@@ -134,6 +135,16 @@ describe Appsignal::Transaction::Formatter do
|
|
134
135
|
:time => 978364860.0,
|
135
136
|
} }
|
136
137
|
its([:failed]) { should be_false }
|
138
|
+
|
139
|
+
context "when queue_time is zero" do
|
140
|
+
let(:payload) { create_background_payload(:queue_start => 0) }
|
141
|
+
|
142
|
+
context "log entry" do
|
143
|
+
subject { formatter.hash[:log_entry] }
|
144
|
+
|
145
|
+
its([:queue_duration]) { should be_nil }
|
146
|
+
end
|
147
|
+
end
|
137
148
|
end
|
138
149
|
end
|
139
150
|
end
|
@@ -355,7 +355,7 @@ describe Appsignal::Transaction do
|
|
355
355
|
|
356
356
|
describe "#set_http_queue_start" do
|
357
357
|
let(:slightly_earlier_time) { fixed_time - 10.0 }
|
358
|
-
let(:slightly_earlier_time_in_msec) { (slightly_earlier_time.to_f *
|
358
|
+
let(:slightly_earlier_time_in_msec) { (slightly_earlier_time.to_f * 1000).to_i }
|
359
359
|
before { transaction.set_http_queue_start }
|
360
360
|
subject { transaction.queue_start }
|
361
361
|
|
@@ -33,7 +33,7 @@ module TransactionHelpers
|
|
33
33
|
def regular_transaction_with_x_request_start
|
34
34
|
appsignal_transaction(
|
35
35
|
:process_action_event => notification_event,
|
36
|
-
'HTTP_X_REQUEST_START' => "t=#{((fixed_time.to_f - 40.0) *
|
36
|
+
'HTTP_X_REQUEST_START' => "t=#{((fixed_time.to_f - 40.0) * 1000).to_i}"
|
37
37
|
)
|
38
38
|
end
|
39
39
|
|
@@ -59,7 +59,7 @@ module TransactionHelpers
|
|
59
59
|
)
|
60
60
|
end
|
61
61
|
|
62
|
-
def background_job_transaction(args={})
|
62
|
+
def background_job_transaction(args={}, payload=create_background_payload)
|
63
63
|
Appsignal::Transaction.create(
|
64
64
|
'1',
|
65
65
|
{
|
@@ -70,7 +70,7 @@ module TransactionHelpers
|
|
70
70
|
o.set_perform_job_event(
|
71
71
|
notification_event(
|
72
72
|
:name => 'perform_job.delayed_job',
|
73
|
-
:payload =>
|
73
|
+
:payload => payload
|
74
74
|
)
|
75
75
|
)
|
76
76
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appsignal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.1.beta.
|
4
|
+
version: 0.8.1.beta.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Beekman
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2014-01-
|
15
|
+
date: 2014-01-05 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: activesupport
|