Module: RubyMethodTracer
- Defined in:
- lib/ruby_method_tracer.rb,
lib/ruby_method_tracer/version.rb,
lib/ruby_method_tracer/call_tree.rb,
lib/ruby_method_tracer/simple_tracer.rb,
lib/ruby_method_tracer/enhanced_tracer.rb,
lib/ruby_method_tracer/formatters/base_formatter.rb,
lib/ruby_method_tracer/formatters/tree_formatter.rb
Overview
Public: Mixin that adds lightweight method tracing to classes.
When included, this module extends the host class with a class-level API (‘trace_methods`) that wraps selected instance methods using `RubyMethodTracer::SimpleTracer`. Wrapped methods record execution timing and errors with minimal overhead, suitable for ad-hoc performance debugging in development or selective tracing in production.
Example
class Worker
include RubyMethodTracer
def perform; do_work; end
end
Worker.trace_methods(:perform, threshold: 0.005, auto_output: true)
See ‘RubyMethodTracer::SimpleTracer` for available options.
Defined Under Namespace
Modules: ClassMethods, Formatters Classes: CallTree, EnhancedTracer, Error, SimpleTracer
Constant Summary collapse
- VERSION =
"0.3.3"
Class Method Summary collapse
Class Method Details
.included(base) ⇒ Object
29 30 31 |
# File 'lib/ruby_method_tracer.rb', line 29 def self.included(base) base.extend(ClassMethods) end |