From 6194e70c8eca8a0f7fa1f7e9590f6929de807288 Mon Sep 17 00:00:00 2001 From: Callum Jones Date: Fri, 4 Dec 2020 16:04:56 -0800 Subject: [PATCH 1/4] Make frequently allocated string a constant This string appears to be allocated a lot but can be moved to a constant. This only improves memory for versions below Ruby 2.3 because I belive Ruby has optimizations going forward that allow it to re-use these immutable strings. --- lib/ddtrace/contrib/ethon/easy_patch.rb | 2 +- lib/ddtrace/contrib/ethon/ext.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ddtrace/contrib/ethon/easy_patch.rb b/lib/ddtrace/contrib/ethon/easy_patch.rb index bb21dda4f5..e1f6eccf8e 100644 --- a/lib/ddtrace/contrib/ethon/easy_patch.rb +++ b/lib/ddtrace/contrib/ethon/easy_patch.rb @@ -99,7 +99,7 @@ def datadog_span_started? def datadog_tag_request span = @datadog_span - method = 'N/A' + method = Ext::NOT_APPLICABLE_METHOD if instance_variable_defined?(:@datadog_method) && !@datadog_method.nil? method = @datadog_method.to_s end diff --git a/lib/ddtrace/contrib/ethon/ext.rb b/lib/ddtrace/contrib/ethon/ext.rb index f5a3a86658..a5cfe30ce8 100644 --- a/lib/ddtrace/contrib/ethon/ext.rb +++ b/lib/ddtrace/contrib/ethon/ext.rb @@ -12,6 +12,7 @@ module Ext SERVICE_NAME = 'ethon'.freeze SPAN_REQUEST = 'ethon.request'.freeze SPAN_MULTI_REQUEST = 'ethon.multi.request'.freeze + NOT_APPLICABLE_METHOD = 'N/A'.freeze end end end From 2006f02953862ac94d19a38b5dc405727c2590c3 Mon Sep 17 00:00:00 2001 From: Callum Jones Date: Mon, 7 Dec 2020 10:07:02 -0800 Subject: [PATCH 2/4] no-op From 7cea7641e4fb65e0f5a30f932d7dd11d98da7399 Mon Sep 17 00:00:00 2001 From: Callum Jones Date: Mon, 7 Dec 2020 11:13:24 -0800 Subject: [PATCH 3/4] jruby bump From 52ce4b09ce6652f1d2a2a3cedce899aa29c946f9 Mon Sep 17 00:00:00 2001 From: Callum Jones Date: Mon, 7 Dec 2020 14:45:43 -0800 Subject: [PATCH 4/4] ci bump