-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Datadog::HTTPTransport #628
Conversation
Ran some basic performance tests, which run the old transport and new transport end-to-end with the agent: TL;DR New and old transport have comparable performance. Old transport: it 'HTTPTransport' do
transport = Datadog::HTTPTransport.new(
ENV.fetch('TEST_DDAGENT_HOST', 'localhost'),
ENV.fetch('TEST_DDAGENT_PORT', 8126)
)
Benchmark.bm do |x|
x.report('HTTPTransport') do
1000.times do
traces = get_test_traces(2)
transport.send(:traces, traces)
end
end
end
end
New transport: it 'Transport::HTTP' do
client = Datadog::Transport::HTTP::Client.new(
Datadog::Transport::HTTP::Service.new(
ENV.fetch('TEST_DDAGENT_HOST', 'localhost'),
ENV.fetch('TEST_DDAGENT_PORT', 8126)
)
)
Benchmark.bm do |x|
x.report('Transport::HTTP') do
1000.times do
traces = get_test_traces(2)
parcel = Datadog::Transport::Traces::Parcel.new(traces)
client.deliver(parcel)
end
end
end
end
|
3d479f3
to
6b20000
Compare
a9f2059
to
de5ca6b
Compare
de5ca6b
to
6aff632
Compare
6aff632
to
d5fb2d7
Compare
d5fb2d7
to
a983c13
Compare
a983c13
to
7ef020c
Compare
7ef020c
to
26eefa1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new design looks quite clean! Great job @delner
#738 removed services from the trace library. This PR should be rebased on those changes, and the corresponding service components removed. |
26eefa1
to
5fdce05
Compare
Rebased this PR on |
1bbf6f7
to
74c8576
Compare
d0a24a3
to
5b89986
Compare
5b89986
to
e2f949b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small question about using an uninstrumented copy of Net::HTTP for transport, otherwise looks good.
Love the new code coverage
0c6e4f1
to
84430ff
Compare
The
Datadog::HTTPTransport
class is quite large and contains a lot of responsibility, which makes it difficult to test, and to extend.The goal for this pull request is to refactor the
HTTPTransport
class to accomplish a few things:What's left to do:
Transport::HTTP
componentsAdd metrics from Add internal tracing metrics #587(Won't do; will revisit this later)