c

org.apache.pekko.remote

PhiAccrualFailureDetector

class PhiAccrualFailureDetector extends FailureDetector

Implementation of 'The Phi Accrual Failure Detector' by Hayashibara et al. as defined in their paper: [https://oneofus.la/have-emacs-will-hack/files/HDY04.pdf]

The suspicion level of failure is given by a value called φ (phi). The basic idea of the φ failure detector is to express the value of φ on a scale that is dynamically adjusted to reflect current network conditions. A configurable threshold is used to decide if φ is considered to be a failure.

The value of φ is calculated as:

φ = -log10(1 - F(timeSinceLastHeartbeat)

where F is the cumulative distribution function of a normal distribution with mean and standard deviation estimated from historical heartbeat inter-arrival times.

Source
PhiAccrualFailureDetector.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PhiAccrualFailureDetector
  2. FailureDetector
  3. AnyRef
  4. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new PhiAccrualFailureDetector(config: Config, ev: EventStream)

    Constructor that reads parameters from config.

    Constructor that reads parameters from config. Expecting config properties named threshold, max-sample-size, min-std-deviation, acceptable-heartbeat-pause and heartbeat-interval.

  2. new PhiAccrualFailureDetector(threshold: Double, maxSampleSize: Int, minStdDeviation: FiniteDuration, acceptableHeartbeatPause: FiniteDuration, firstHeartbeatEstimate: FiniteDuration)(implicit clock: Clock)

    Constructor without eventStream to support backwards compatibility

  3. new PhiAccrualFailureDetector(threshold: Double, maxSampleSize: Int, minStdDeviation: FiniteDuration, acceptableHeartbeatPause: FiniteDuration, firstHeartbeatEstimate: FiniteDuration, eventStream: Option[EventStream])(implicit clock: Clock)

    threshold

    A low threshold is prone to generate many wrong suspicions but ensures a quick detection in the event of a real crash. Conversely, a high threshold generates fewer mistakes but needs more time to detect actual crashes

    maxSampleSize

    Number of samples to use for calculation of mean and standard deviation of inter-arrival times.

    minStdDeviation

    Minimum standard deviation to use for the normal distribution used when calculating phi. Too low standard deviation might result in too much sensitivity for sudden, but normal, deviations in heartbeat inter arrival times.

    acceptableHeartbeatPause

    Duration corresponding to number of potentially lost/delayed heartbeats that will be accepted before considering it to be an anomaly. This margin is important to be able to survive sudden, occasional, pauses in heartbeat arrivals, due to for example garbage collect or network drop.

    firstHeartbeatEstimate

    Bootstrap the stats with heartbeats that corresponds to to this duration, with a with rather high standard deviation (since environment is unknown in the beginning)

    clock

    The clock, returning current time in milliseconds, but can be faked for testing purposes. It is only used for measuring intervals (duration).

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from PhiAccrualFailureDetector toany2stringadd[PhiAccrualFailureDetector] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (PhiAccrualFailureDetector, B)
    Implicit
    This member is added by an implicit conversion from PhiAccrualFailureDetector toArrowAssoc[PhiAccrualFailureDetector] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. val acceptableHeartbeatPause: FiniteDuration
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  9. def ensuring(cond: (PhiAccrualFailureDetector) => Boolean, msg: => Any): PhiAccrualFailureDetector
    Implicit
    This member is added by an implicit conversion from PhiAccrualFailureDetector toEnsuring[PhiAccrualFailureDetector] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: (PhiAccrualFailureDetector) => Boolean): PhiAccrualFailureDetector
    Implicit
    This member is added by an implicit conversion from PhiAccrualFailureDetector toEnsuring[PhiAccrualFailureDetector] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean, msg: => Any): PhiAccrualFailureDetector
    Implicit
    This member is added by an implicit conversion from PhiAccrualFailureDetector toEnsuring[PhiAccrualFailureDetector] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean): PhiAccrualFailureDetector
    Implicit
    This member is added by an implicit conversion from PhiAccrualFailureDetector toEnsuring[PhiAccrualFailureDetector] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  15. val firstHeartbeatEstimate: FiniteDuration
  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  18. final def heartbeat(): Unit

    Notifies the FailureDetector that a heartbeat arrived from the monitored resource.

    Notifies the FailureDetector that a heartbeat arrived from the monitored resource. This causes the FailureDetector to update its state.

    Definition Classes
    PhiAccrualFailureDetectorFailureDetector
    Annotations
    @tailrec()
  19. def isAvailable: Boolean

    Returns true if the resource is considered to be up and healthy and returns false otherwise.

    Returns true if the resource is considered to be up and healthy and returns false otherwise.

    Definition Classes
    PhiAccrualFailureDetectorFailureDetector
  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. def isMonitoring: Boolean

    Returns true if the failure detector has received any heartbeats and started monitoring of the resource.

    Returns true if the failure detector has received any heartbeats and started monitoring of the resource.

    Definition Classes
    PhiAccrualFailureDetectorFailureDetector
  22. val maxSampleSize: Int
  23. val minStdDeviation: FiniteDuration
  24. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  26. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  27. def phi: Double

    The suspicion level of the accrual failure detector.

    The suspicion level of the accrual failure detector.

    If a connection does not have any records in failure detector then it is considered healthy.

  28. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  29. val threshold: Double
  30. def toString(): String
    Definition Classes
    AnyRef → Any
  31. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  32. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

  2. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from PhiAccrualFailureDetector toStringFormat[PhiAccrualFailureDetector] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.12.16) Use formatString.format(value) instead of value.formatted(formatString), or use the f"" string interpolator. In Java 15 and later, formatted resolves to the new method in String which has reversed parameters.

  3. def [B](y: B): (PhiAccrualFailureDetector, B)
    Implicit
    This member is added by an implicit conversion from PhiAccrualFailureDetector toArrowAssoc[PhiAccrualFailureDetector] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from FailureDetector

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd fromPhiAccrualFailureDetector to any2stringadd[PhiAccrualFailureDetector]

Inherited by implicit conversion StringFormat fromPhiAccrualFailureDetector to StringFormat[PhiAccrualFailureDetector]

Inherited by implicit conversion Ensuring fromPhiAccrualFailureDetector to Ensuring[PhiAccrualFailureDetector]

Inherited by implicit conversion ArrowAssoc fromPhiAccrualFailureDetector to ArrowAssoc[PhiAccrualFailureDetector]

Ungrouped