Class: RegoValidate::Profiler::Sample
- Inherits:
-
Struct
- Object
- Struct
- RegoValidate::Profiler::Sample
- Defined in:
- lib/ruby/rego/cli/profiling.rb,
lib/ruby/rego/cli/profiling.rb
Overview
Rendering helpers for profiler samples.
Instance Attribute Summary collapse
-
#allocations ⇒ Object
Returns the value of attribute allocations.
-
#duration_ms ⇒ Object
Returns the value of attribute duration_ms.
-
#label ⇒ Object
Returns the value of attribute label.
-
#memory_bytes ⇒ Object
Returns the value of attribute memory_bytes.
-
#top_objects ⇒ Object
Returns the value of attribute top_objects.
Instance Method Summary collapse
Instance Attribute Details
#allocations ⇒ Object
Returns the value of attribute allocations
8 9 10 |
# File 'lib/ruby/rego/cli/profiling.rb', line 8 def allocations @allocations end |
#duration_ms ⇒ Object
Returns the value of attribute duration_ms
8 9 10 |
# File 'lib/ruby/rego/cli/profiling.rb', line 8 def duration_ms @duration_ms end |
#label ⇒ Object
Returns the value of attribute label
8 9 10 |
# File 'lib/ruby/rego/cli/profiling.rb', line 8 def label @label end |
#memory_bytes ⇒ Object
Returns the value of attribute memory_bytes
8 9 10 |
# File 'lib/ruby/rego/cli/profiling.rb', line 8 def memory_bytes @memory_bytes end |
#top_objects ⇒ Object
Returns the value of attribute top_objects
8 9 10 |
# File 'lib/ruby/rego/cli/profiling.rb', line 8 def top_objects @top_objects end |
Instance Method Details
#report_line ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/ruby/rego/cli/profiling.rb', line 12 def report_line parts = [ " #{label}: #{format_duration}", "allocs +#{allocations}", "mem #{format_bytes}" ] parts.join(", ") end |
#top_objects_line ⇒ Object
21 22 23 24 25 |
# File 'lib/ruby/rego/cli/profiling.rb', line 21 def top_objects_line return nil if top_objects.empty? " top allocations: #{top_objects.join(", ")}" end |