Class: InstrumentAllTheThings::Context

Inherits:
Struct
  • Object
show all
Defined in:
lib/instrument_all_the_things/context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#instanceObject

Returns the value of attribute instance

Returns:

  • (Object)

    the current value of instance



4
5
6
# File 'lib/instrument_all_the_things/context.rb', line 4

def instance
  @instance
end

#method_nameObject

Returns the value of attribute method_name

Returns:

  • (Object)

    the current value of method_name



4
5
6
# File 'lib/instrument_all_the_things/context.rb', line 4

def method_name
  @method_name
end

#tagsObject

Returns the value of attribute tags

Returns:

  • (Object)

    the current value of tags



4
5
6
# File 'lib/instrument_all_the_things/context.rb', line 4

def tags
  @tags
end

Instance Method Details

#stats_name(klass_or_instance) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/instrument_all_the_things/context.rb', line 5

def stats_name(klass_or_instance)
  @stats_name ||= [
    class_name(klass_or_instance),
    "#{instance ? 'instance' : 'class'}_methods",
    method_name,
  ].join('.')
end

#trace_name(klass_or_instance) ⇒ Object



13
14
15
# File 'lib/instrument_all_the_things/context.rb', line 13

def trace_name(klass_or_instance)
  @trace_name ||= "#{class_name(klass_or_instance)}#{instance ? '.' : '#'}#{method_name}"
end