Class: Betterp::Configuration::ProfilingThreshold

Inherits:
Object
  • Object
show all
Defined in:
lib/betterp/configuration.rb

Overview

Configures colors to use for different profiling durations, defines low, medium, and high colors.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#high=(value) ⇒ Object

Sets the attribute high

Parameters:

  • value

    the value to set the attribute high to.



12
13
14
# File 'lib/betterp/configuration.rb', line 12

def high=(value)
  @high = value
end

#low=(value) ⇒ Object

Sets the attribute low

Parameters:

  • value

    the value to set the attribute low to.



12
13
14
# File 'lib/betterp/configuration.rb', line 12

def low=(value)
  @low = value
end

Instance Method Details

#color(duration) ⇒ Object



14
15
16
17
18
19
# File 'lib/betterp/configuration.rb', line 14

def color(duration)
  return :green if low?(duration)
  return :yellow if medium?(duration)

  :red if high?(duration)
end