Class: SimpleProfiler::Event
- Inherits:
-
Struct
- Object
- Struct
- SimpleProfiler::Event
- Defined in:
- lib/simple_profiler/event.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#finalized_at ⇒ Object
Returns the value of attribute finalized_at.
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#memory_at_beginning ⇒ Object
Returns the value of attribute memory_at_beginning.
-
#memory_at_end ⇒ Object
Returns the value of attribute memory_at_end.
-
#method ⇒ Object
Returns the value of attribute method.
-
#started_at ⇒ Object
Returns the value of attribute started_at.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args
2 3 4 |
# File 'lib/simple_profiler/event.rb', line 2 def args @args end |
#finalized_at ⇒ Object
Returns the value of attribute finalized_at
2 3 4 |
# File 'lib/simple_profiler/event.rb', line 2 def finalized_at @finalized_at end |
#klass ⇒ Object
Returns the value of attribute klass
2 3 4 |
# File 'lib/simple_profiler/event.rb', line 2 def klass @klass end |
#memory_at_beginning ⇒ Object
Returns the value of attribute memory_at_beginning
2 3 4 |
# File 'lib/simple_profiler/event.rb', line 2 def memory_at_beginning @memory_at_beginning end |
#memory_at_end ⇒ Object
Returns the value of attribute memory_at_end
2 3 4 |
# File 'lib/simple_profiler/event.rb', line 2 def memory_at_end @memory_at_end end |
#method ⇒ Object
Returns the value of attribute method
2 3 4 |
# File 'lib/simple_profiler/event.rb', line 2 def method @method end |
#started_at ⇒ Object
Returns the value of attribute started_at
2 3 4 |
# File 'lib/simple_profiler/event.rb', line 2 def started_at @started_at end |
#target ⇒ Object
Returns the value of attribute target
2 3 4 |
# File 'lib/simple_profiler/event.rb', line 2 def target @target end |
Instance Method Details
#to_s ⇒ Object
12 13 14 15 |
# File 'lib/simple_profiler/event.rb', line 12 def to_s separator = target == :class ? '.' : '#' "#{klass}#{separator}#{method} -> #{total_time.round(4)} sec. - #{used_memory}MB - (Total Memory: #{memory_at_end}MB)" end |
#total_time ⇒ Object
4 5 6 |
# File 'lib/simple_profiler/event.rb', line 4 def total_time finalized_at - started_at end |
#used_memory ⇒ Object
8 9 10 |
# File 'lib/simple_profiler/event.rb', line 8 def used_memory memory_at_end - memory_at_beginning end |