class Kitchen::Oven::BakeProfile

Stats on baking

Public Instance Methods

bake_seconds() click to toggle source

Return the number of seconds it took to bake the parsed file or nil if this info isn't available. @return [Float, nil]

# File lib/kitchen/oven.rb, line 88
def bake_seconds
  @baked_at - @parsed_at
rescue NoMethodError
  nil
end
baked!() click to toggle source

Record that the input file has been baked

# File lib/kitchen/oven.rb, line 62
def baked!;   @baked_at = Time.now;   end
open_seconds() click to toggle source

Return the number of seconds it took to open the input file or nil if this info isn't available. @return [Float, nil]

# File lib/kitchen/oven.rb, line 70
def open_seconds
  @opened_at - @started_at
rescue NoMethodError
  nil
end
opened!() click to toggle source

Record that the input file has been opened

# File lib/kitchen/oven.rb, line 56
def opened!;  @opened_at = Time.now;  end
parse_seconds() click to toggle source

Return the number of seconds it took to parse the input file after opening or nil if this info isn't available. @return [Float, nil]

# File lib/kitchen/oven.rb, line 79
def parse_seconds
  @parsed_at - @opened_at
rescue NoMethodError
  nil
end
parsed!() click to toggle source

Record that the input file has been parsed

# File lib/kitchen/oven.rb, line 59
def parsed!;  @parsed_at = Time.now;  end
started!() click to toggle source

Record that baking has started

# File lib/kitchen/oven.rb, line 53
def started!; @started_at = Time.now; end
to_s() click to toggle source

Return the profile stats as a string @return [String]

# 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() click to toggle source

Return the number of seconds it took to write the baked file or nil if this info isn't available. @return [Float, nil]

# File lib/kitchen/oven.rb, line 97
def write_seconds
  @written_at - @baked_at
rescue NoMethodError
  nil
end
written!() click to toggle source

Record that the output file has been written

# File lib/kitchen/oven.rb, line 65
def written!; @written_at = Time.now; end