-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate
set_http_or_background_queue_start
(#1175)
Deprecate the `Transaction#set_http_or_background_queue_start` method so that the transaction doesn't need to know about any 'request' set on the transaction. The instrumentations themselves can set the queue start using the `Transaction#set_queue_start` method. Move the logic for conversion of the queue start time from request headers to a utils class so it can be accessed by the instrumentations.
- Loading branch information
Showing
12 changed files
with
173 additions
and
44 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
...gesets/deprecate--appsignal--transaction-set_http_or_background_queue_start-.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
bump: patch | ||
type: deprecate | ||
--- | ||
|
||
Deprecate the `Appsignal::Transaction#set_http_or_background_queue_start` method. Use the `Appsignal::Transaction#set_queue_start` instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
describe Appsignal::Rack::Utils do | ||
describe ".queue_start_from" do | ||
let(:header_time) { fixed_time - 0.4 } | ||
let(:header_time_value) { (header_time * factor).to_i } | ||
subject { described_class.queue_start_from(env) } | ||
|
||
shared_examples "HTTP queue start" do | ||
context "when env is nil" do | ||
let(:env) { nil } | ||
|
||
it { is_expected.to be_nil } | ||
end | ||
|
||
context "with no relevant header set" do | ||
let(:env) { {} } | ||
|
||
it { is_expected.to be_nil } | ||
end | ||
|
||
context "with the HTTP_X_REQUEST_START header set" do | ||
let(:env) { { "HTTP_X_REQUEST_START" => "t=#{header_time_value}" } } | ||
|
||
it { is_expected.to eq 1_389_783_599_600 } | ||
|
||
context "with unparsable content" do | ||
let(:env) { { "HTTP_X_REQUEST_START" => "something" } } | ||
|
||
it { is_expected.to be_nil } | ||
end | ||
|
||
context "with unparsable content at the end" do | ||
let(:env) { { "HTTP_X_REQUEST_START" => "t=#{header_time_value}aaaa" } } | ||
|
||
it { is_expected.to eq 1_389_783_599_600 } | ||
end | ||
|
||
context "with a really low number" do | ||
let(:env) { { "HTTP_X_REQUEST_START" => "t=100" } } | ||
|
||
it { is_expected.to be_nil } | ||
end | ||
|
||
context "with the alternate HTTP_X_QUEUE_START header set" do | ||
let(:env) { { "HTTP_X_QUEUE_START" => "t=#{header_time_value}" } } | ||
|
||
it { is_expected.to eq 1_389_783_599_600 } | ||
end | ||
end | ||
end | ||
|
||
context "time in milliseconds" do | ||
let(:factor) { 1_000 } | ||
|
||
it_should_behave_like "HTTP queue start" | ||
end | ||
|
||
context "time in microseconds" do | ||
let(:factor) { 1_000_000 } | ||
|
||
it_should_behave_like "HTTP queue start" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters