Class: Vernier::ParsedProfile::Thread

Inherits:
Object
  • Object
show all
Defined in:
lib/vernier/parsed_profile.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Thread

Returns a new instance of Thread.



60
61
62
# File 'lib/vernier/parsed_profile.rb', line 60

def initialize(data)
  @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



58
59
60
# File 'lib/vernier/parsed_profile.rb', line 58

def data
  @data
end

Instance Method Details

#[](name) ⇒ Object

Emulate hash



81
82
83
# File 'lib/vernier/parsed_profile.rb', line 81

def [](name)
  send(name)
end

#main_thread?Boolean

Returns:

  • (Boolean)


68
69
70
# File 'lib/vernier/parsed_profile.rb', line 68

def main_thread?
  @data["isMainThread"]
end

#samplesObject



72
73
74
# File 'lib/vernier/parsed_profile.rb', line 72

def samples
  @data["samples"]["stack"]
end

#stack_tableObject



64
65
66
# File 'lib/vernier/parsed_profile.rb', line 64

def stack_table
  @stack_table ||= StackTable.new(@data)
end

#weightsObject



76
77
78
# File 'lib/vernier/parsed_profile.rb', line 76

def weights
  @data["samples"]["weight"]
end