Class: Vicary::LatencyBaseline::Comparison

Inherits:
Struct
  • Object
show all
Defined in:
lib/vicary/latency_baseline.rb

Overview

The gate's answer, and — when it declines — why.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#againstObject

Returns the value of attribute against

Returns:

  • (Object)

    the current value of against



77
78
79
# File 'lib/vicary/latency_baseline.rb', line 77

def against
  @against
end

#comparableObject

Returns the value of attribute comparable

Returns:

  • (Object)

    the current value of comparable



77
78
79
# File 'lib/vicary/latency_baseline.rb', line 77

def comparable
  @comparable
end

#current_msObject

Returns the value of attribute current_ms

Returns:

  • (Object)

    the current value of current_ms



77
78
79
# File 'lib/vicary/latency_baseline.rb', line 77

def current_ms
  @current_ms
end

#measured_msObject

Returns the value of attribute measured_ms

Returns:

  • (Object)

    the current value of measured_ms



77
78
79
# File 'lib/vicary/latency_baseline.rb', line 77

def measured_ms
  @measured_ms
end

#previous_msObject

Returns the value of attribute previous_ms

Returns:

  • (Object)

    the current value of previous_ms



77
78
79
# File 'lib/vicary/latency_baseline.rb', line 77

def previous_ms
  @previous_ms
end

#reasonObject

Returns the value of attribute reason

Returns:

  • (Object)

    the current value of reason



77
78
79
# File 'lib/vicary/latency_baseline.rb', line 77

def reason
  @reason
end

#regression_pctObject

Returns the value of attribute regression_pct

Returns:

  • (Object)

    the current value of regression_pct



77
78
79
# File 'lib/vicary/latency_baseline.rb', line 77

def regression_pct
  @regression_pct
end

#tolerance_pctObject

Returns the value of attribute tolerance_pct

Returns:

  • (Object)

    the current value of tolerance_pct



77
78
79
# File 'lib/vicary/latency_baseline.rb', line 77

def tolerance_pct
  @tolerance_pct
end

Instance Method Details

#holds?Boolean

Returns:

  • (Boolean)


82
83
84
85
86
# File 'lib/vicary/latency_baseline.rb', line 82

def holds?
  return false unless comparable && !regression_pct.nil?

  regression_pct <= tolerance_pct
end