Class: BreakerMachines::Event

Inherits:
Data
  • Object
show all
Defined in:
lib/breaker_machines/types.rb

Overview

Represents an event in the circuit’s event log

Returns:

  • (Symbol)

    type - the event type (:success, :failure, :state_change)

  • (Float)

    timestamp - the monotonic timestamp

  • (Float)

    duration - the duration in milliseconds

  • (String, nil)

    error - the error message if applicable

  • (Symbol, nil)

    new_state - the new state if this was a state change

Instance Attribute Summary collapse

Instance Attribute Details

#durationObject (readonly)

Returns the value of attribute duration

Returns:

  • (Object)

    the current value of duration



40
41
42
# File 'lib/breaker_machines/types.rb', line 40

def duration
  @duration
end

#errorObject (readonly)

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



40
41
42
# File 'lib/breaker_machines/types.rb', line 40

def error
  @error
end

#new_stateObject (readonly)

Returns the value of attribute new_state

Returns:

  • (Object)

    the current value of new_state



40
41
42
# File 'lib/breaker_machines/types.rb', line 40

def new_state
  @new_state
end

#timestampObject (readonly)

Returns the value of attribute timestamp

Returns:

  • (Object)

    the current value of timestamp



40
41
42
# File 'lib/breaker_machines/types.rb', line 40

def timestamp
  @timestamp
end

#typeObject (readonly)

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



40
41
42
# File 'lib/breaker_machines/types.rb', line 40

def type
  @type
end