Class: Datadog::Profiling::Buffer
- Inherits:
-
ThreadSafeBuffer
- Object
- Buffer
- ThreadSafeBuffer
- Datadog::Profiling::Buffer
- Defined in:
- lib/ddtrace/profiling/buffer.rb
Overview
Profiling buffer that stores profiling events. The buffer has a maximum size and when the buffer is full, a random event is discarded. This class is thread-safe.
Instance Method Summary collapse
- #cache(cache_name) ⇒ Object
-
#initialize(*args) ⇒ Buffer
constructor
A new instance of Buffer.
- #string_table ⇒ Object
Methods inherited from ThreadSafeBuffer
#close, #concat, #empty?, #length, #pop, #push, #synchronize
Methods inherited from Buffer
#close, #closed?, #concat, #empty?, #length, #pop, #push
Constructor Details
#initialize(*args) ⇒ Buffer
Returns a new instance of Buffer.
11 12 13 14 15 |
# File 'lib/ddtrace/profiling/buffer.rb', line 11 def initialize(*args) super @caches = {} @string_table = Utils::StringTable.new end |
Instance Method Details
#cache(cache_name) ⇒ Object
17 18 19 20 21 |
# File 'lib/ddtrace/profiling/buffer.rb', line 17 def cache(cache_name) synchronize do @caches[cache_name] ||= Utils::ObjectSet.new end end |
#string_table ⇒ Object
23 24 25 26 27 |
# File 'lib/ddtrace/profiling/buffer.rb', line 23 def string_table synchronize do @string_table end end |