Class: Kitchen::Oven::BakeProfile
Overview
Stats on baking
Instance Method Summary collapse
-
#bake_seconds ⇒ Float?
Return the number of seconds it took to bake the parsed file or nil if this info isn’t available.
-
#baked! ⇒ Object
Record that the input file has been baked.
-
#open_seconds ⇒ Float?
Return the number of seconds it took to open the input file or nil if this info isn’t available.
-
#opened! ⇒ Object
Record that the input file has been opened.
-
#parse_seconds ⇒ Float?
Return the number of seconds it took to parse the input file after opening or nil if this info isn’t available.
-
#parsed! ⇒ Object
Record that the input file has been parsed.
-
#started! ⇒ Object
Record that baking has started.
-
#to_s ⇒ String
Return the profile stats as a string.
-
#write_seconds ⇒ Float?
Return the number of seconds it took to write the baked file or nil if this info isn’t available.
-
#written! ⇒ Object
Record that the output file has been written.
Instance Method Details
#bake_seconds ⇒ Float?
Return the number of seconds it took to bake the parsed file or nil if this info isn’t available.
88 89 90 91 92 |
# File 'lib/kitchen/oven.rb', line 88 def bake_seconds @baked_at - @parsed_at rescue NoMethodError nil end |
#baked! ⇒ Object
Record that the input file has been baked
62 |
# File 'lib/kitchen/oven.rb', line 62 def baked!; @baked_at = Time.now; end |
#open_seconds ⇒ Float?
Return the number of seconds it took to open the input file or nil if this info isn’t available.
70 71 72 73 74 |
# File 'lib/kitchen/oven.rb', line 70 def open_seconds @opened_at - @started_at rescue NoMethodError nil end |
#opened! ⇒ Object
Record that the input file has been opened
56 |
# File 'lib/kitchen/oven.rb', line 56 def opened!; @opened_at = Time.now; end |
#parse_seconds ⇒ Float?
Return the number of seconds it took to parse the input file after opening or nil if this info isn’t available.
79 80 81 82 83 |
# File 'lib/kitchen/oven.rb', line 79 def parse_seconds @parsed_at - @opened_at rescue NoMethodError nil end |
#parsed! ⇒ Object
Record that the input file has been parsed
59 |
# File 'lib/kitchen/oven.rb', line 59 def parsed!; @parsed_at = Time.now; end |
#started! ⇒ Object
Record that baking has started
53 |
# File 'lib/kitchen/oven.rb', line 53 def started!; @started_at = Time.now; end |
#to_s ⇒ String
Return the profile stats as a string
105 106 107 108 109 110 111 112 |
# File 'lib/kitchen/oven.rb', line 105 def to_s <<~STRING Open: #{open_seconds || '??'} s Parse: #{parse_seconds || '??'} s Bake: #{bake_seconds || '??'} s Write: #{write_seconds || '??'} s STRING end |
#write_seconds ⇒ Float?
Return the number of seconds it took to write the baked file or nil if this info isn’t available.
97 98 99 100 101 |
# File 'lib/kitchen/oven.rb', line 97 def write_seconds @written_at - @baked_at rescue NoMethodError nil end |
#written! ⇒ Object
Record that the output file has been written
65 |
# File 'lib/kitchen/oven.rb', line 65 def written!; @written_at = Time.now; end |