Class: StackifyRubyAPM::StacktraceBuilder Private

Inherits:
Object
  • Object
show all
Defined in:
lib/stackify_apm/stacktrace_builder.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary collapse

JAVA_FORMAT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

/^(.+)\.([^\.]+)\(([^\:]+)\:(\d+)\)$/
RUBY_FORMAT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

/^(.+?):(\d+)(?::in `(.+?)')?$/
RUBY_VERS_REGEX =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

%r{ruby(/gems)?[-/](\d+\.)+\d}
JRUBY_ORG_REGEX =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

%r{org/jruby}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(agent) ⇒ StacktraceBuilder

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of StacktraceBuilder.



17
18
19
20
# File 'lib/stackify_apm/stacktrace_builder.rb', line 17

def initialize(agent)
  @config = agent.config
  @cache = Util::LruCache.new(2048, &method(:build_frame))
end

Instance Attribute Details

#configObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



22
23
24
# File 'lib/stackify_apm/stacktrace_builder.rb', line 22

def config
  @config
end

Instance Method Details

#build(backtrace, type) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



24
25
26
27
28
29
30
# File 'lib/stackify_apm/stacktrace_builder.rb', line 24

def build(backtrace, type)
  Stacktrace.new.tap do |s|
    s.frames = backtrace.map do |line|
      @cache[[line, type]]
    end
  end
end