Skip to content

Commit 1f877ff

Browse files
authored
Fix method override warning in profiler (#4549)
1 parent 25669fd commit 1f877ff

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/datadog/profiling.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,11 @@ def self.wait_until_running(timeout_seconds: 5)
7878
end
7979

8080
private_class_method def self.replace_noop_allocation_count
81-
def self.allocation_count # rubocop:disable Lint/NestedMethodDefinition (On purpose!)
82-
Datadog::Profiling::Collectors::CpuAndWallTimeWorker._native_allocation_count
81+
class << self
82+
remove_method :allocation_count
83+
def allocation_count
84+
Datadog::Profiling::Collectors::CpuAndWallTimeWorker._native_allocation_count
85+
end
8386
end
8487
end
8588

0 commit comments

Comments
 (0)