Class QoSConfig


  • public class QoSConfig
    extends java.lang.Object
    Represents the global configuration of the QoS feature.
    Author:
    https://github.com/ljucam [Mario Ljuca]
    • Constructor Summary

      Constructors 
      Constructor Description
      QoSConfig​(int percentile, int quorum, int period, int minSampleCount, int minSentinelCount)
      Creates a new global configuration object for the QoS.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getMinSampleCount()
      Returns the amount of samples which a sentinel has to provide to be counted as a valid sentinel.
      int getMinSentinelCount()
      Returns the amount of sentinels which must be available to perform a QoS calculation.
      protected int getPercentile()
      Returns the percentile which should be read from the metrics (sentinels).
      protected int getPeriod()
      Returns the period in seconds, after which the QoS calculation is executed.
      protected int getQuorum()
      Returns how many percent of all api's must be over the defined ratio, so the given api is rejected.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • QoSConfig

        public QoSConfig​(int percentile,
                         int quorum,
                         int period,
                         int minSampleCount,
                         int minSentinelCount)
        Creates a new global configuration object for the QoS.
        Parameters:
        percentile - the percentile which should be read from the metrics (sentinels).
        quorum - defines how many percent of all api's must be over the defined ratio, so the given api is rejected.
        period - defines the period in seconds after which the calculation is executed.
        minSampleCount - defines the min. samples count of a sentinel so it can be used for the QoS calc.
        minSentinelCount - defines the min. sentinel count used to perform a QoS calc.
    • Method Detail

      • getPercentile

        protected int getPercentile()
        Returns the percentile which should be read from the metrics (sentinels).
        Returns:
        the percentile value
      • getQuorum

        protected int getQuorum()
        Returns how many percent of all api's must be over the defined ratio, so the given api is rejected.
        Returns:
        a percent value
      • getPeriod

        protected int getPeriod()
        Returns the period in seconds, after which the QoS calculation is executed.
        Returns:
        time value in seconds
      • getMinSampleCount

        public int getMinSampleCount()
        Returns the amount of samples which a sentinel has to provide to be counted as a valid sentinel.
        Returns:
        min amount of samples
      • getMinSentinelCount

        public int getMinSentinelCount()
        Returns the amount of sentinels which must be available to perform a QoS calculation.
        Returns:
        min amount of sentinels