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.
102 103 104 105 106 |
# File 'lib/kitchen/oven.rb', line 102 def bake_seconds @baked_at - @parsed_at rescue NoMethodError nil end |
#baked! ⇒ Object
Record that the input file has been baked
76 |
# File 'lib/kitchen/oven.rb', line 76 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.
84 85 86 87 88 |
# File 'lib/kitchen/oven.rb', line 84 def open_seconds @opened_at - @started_at rescue NoMethodError nil end |
#opened! ⇒ Object
Record that the input file has been opened
70 |
# File 'lib/kitchen/oven.rb', line 70 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.
93 94 95 96 97 |
# File 'lib/kitchen/oven.rb', line 93 def parse_seconds @parsed_at - @opened_at rescue NoMethodError nil end |
#parsed! ⇒ Object
Record that the input file has been parsed
73 |
# File 'lib/kitchen/oven.rb', line 73 def parsed!; @parsed_at = Time.now; end |
#started! ⇒ Object
Record that baking has started
67 |
# File 'lib/kitchen/oven.rb', line 67 def started!; @started_at = Time.now; end |
#to_s ⇒ String
Return the profile stats as a string
119 120 121 122 123 124 125 126 |
# File 'lib/kitchen/oven.rb', line 119 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.
111 112 113 114 115 |
# File 'lib/kitchen/oven.rb', line 111 def write_seconds @written_at - @baked_at rescue NoMethodError nil end |
#written! ⇒ Object
Record that the output file has been written
79 |
# File 'lib/kitchen/oven.rb', line 79 def written!; @written_at = Time.now; end |