Class: RegoValidate::Profiler::Sample
- Inherits:
-
Struct
- Object
- Struct
- RegoValidate::Profiler::Sample
- Defined in:
- lib/ruby/rego/cli.rb,
lib/ruby/rego/cli.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
506 507 508 |
# File 'lib/ruby/rego/cli.rb', line 506 def allocations @allocations end |
#duration_ms ⇒ Object
Returns the value of attribute duration_ms
506 507 508 |
# File 'lib/ruby/rego/cli.rb', line 506 def duration_ms @duration_ms end |
#label ⇒ Object
Returns the value of attribute label
506 507 508 |
# File 'lib/ruby/rego/cli.rb', line 506 def label @label end |
#memory_bytes ⇒ Object
Returns the value of attribute memory_bytes
506 507 508 |
# File 'lib/ruby/rego/cli.rb', line 506 def memory_bytes @memory_bytes end |
#top_objects ⇒ Object
Returns the value of attribute top_objects
506 507 508 |
# File 'lib/ruby/rego/cli.rb', line 506 def top_objects @top_objects end |
Instance Method Details
#report_line ⇒ Object
510 511 512 513 514 515 516 517 |
# File 'lib/ruby/rego/cli.rb', line 510 def report_line parts = [ " #{label}: #{format_duration}", "allocs +#{allocations}", "mem #{format_bytes}" ] parts.join(", ") end |
#top_objects_line ⇒ Object
519 520 521 522 523 |
# File 'lib/ruby/rego/cli.rb', line 519 def top_objects_line return nil if top_objects.empty? " top allocations: #{top_objects.join(", ")}" end |