Class UsageInfo


  • public class UsageInfo
    extends java.lang.Object
    Information about service usage.
    • Field Detail

      • starttime

        protected long starttime
        The start time.
      • usages

        protected double usages
        The number of usages in the last time interval.
    • Constructor Detail

      • UsageInfo

        public UsageInfo()
        Create a new UsageInfo.
      • UsageInfo

        public UsageInfo​(IServiceIdentifier sid,
                         long starttime,
                         double usages)
        Create a new UsageInfo.
    • Method Detail

      • getServiceIdentifier

        public IServiceIdentifier getServiceIdentifier()
        Get the serviceIdentifier.
        Returns:
        the serviceIdentifier
      • getStartTime

        public long getStartTime()
        Get the startTime.
        Returns:
        the startTime
      • setStartTime

        public void setStartTime​(long startTime)
        Set the startTime.
        Parameters:
        startTime - The startTime to set
      • setServiceIdentifier

        public void setServiceIdentifier​(IServiceIdentifier sid)
        Set the serviceIdentifier.
        Parameters:
        sid - The serviceIdentifier to set
      • getUsages

        public double getUsages()
        Get the usages.
        Returns:
        the usages
      • setUsages

        public void setUsages​(double usages)
        Set the usages.
        Parameters:
        usages - The usages to set
      • integrateUsage

        public void integrateUsage​(UsageInfo ui)
        Integrate a new usage info. Uses ema to average the values.
      • calculateEma

        protected double calculateEma​(double newval,
                                      double val)
        Calculate the exponential moving average.