Class: TWPipeline::Bench::Sample
- Inherits:
-
Data
- Object
- Data
- TWPipeline::Bench::Sample
- Defined in:
- lib/twpipeline/bench.rb,
sig/twpipeline.rbs
Instance Attribute Summary collapse
-
#cpu_seconds ⇒ Object
readonly
Returns the value of attribute cpu_seconds.
-
#facts ⇒ Object
readonly
Returns the value of attribute facts.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#peak_rss_bytes ⇒ Object
readonly
Returns the value of attribute peak_rss_bytes.
-
#seconds ⇒ Object
readonly
Returns the value of attribute seconds.
Instance Method Summary collapse
Instance Attribute Details
#cpu_seconds ⇒ Object (readonly)
Returns the value of attribute cpu_seconds
9 10 11 |
# File 'lib/twpipeline/bench.rb', line 9 def cpu_seconds @cpu_seconds end |
#facts ⇒ Object (readonly)
Returns the value of attribute facts
9 10 11 |
# File 'lib/twpipeline/bench.rb', line 9 def facts @facts end |
#label ⇒ Object (readonly)
Returns the value of attribute label
9 10 11 |
# File 'lib/twpipeline/bench.rb', line 9 def label @label end |
#peak_rss_bytes ⇒ Object (readonly)
Returns the value of attribute peak_rss_bytes
9 10 11 |
# File 'lib/twpipeline/bench.rb', line 9 def peak_rss_bytes @peak_rss_bytes end |
#seconds ⇒ Object (readonly)
Returns the value of attribute seconds
9 10 11 |
# File 'lib/twpipeline/bench.rb', line 9 def seconds @seconds end |
Instance Method Details
#cores_used ⇒ ::Float
10 |
# File 'lib/twpipeline/bench.rb', line 10 def cores_used = seconds.zero? ? 0.0 : cpu_seconds / seconds |
#to_h ⇒ ::Hash[::Symbol, untyped]
12 13 14 15 16 17 18 19 20 |
# File 'lib/twpipeline/bench.rb', line 12 def to_h { label: label, seconds: seconds.round(3), cpu_seconds: cpu_seconds.round(3), cores_used: cores_used.round(2), peak_rss_bytes: peak_rss_bytes }.merge(facts) end |