Class DefaultLoad

  • All Implemented Interfaces:
    Load

    public class DefaultLoad
    extends Object
    implements Load
    Implementation of a load.
    • Constructor Detail

      • DefaultLoad

        public DefaultLoad()
        Creates an invalid load.
      • DefaultLoad

        public DefaultLoad​(long current,
                           long previous)
        Creates a load value from the parameters.
        Parameters:
        current - the current value
        previous - the previous value
      • DefaultLoad

        public DefaultLoad​(long current,
                           long previous,
                           long interval)
        Creates a load value from the parameters.
        Parameters:
        current - the current value
        previous - the previous value
        interval - poll interval for this load
    • Method Detail

      • setPollInterval

        public static void setPollInterval​(long newPollInterval)
        Sets the poll interval in seconds. Used solely for the purpose of computing the load.
        Parameters:
        newPollInterval - poll interval duration in seconds
      • rate

        public long rate()
        Description copied from interface: Load
        Obtain the current observed rate (in bytes/s) on a link.
        Specified by:
        rate in interface Load
        Returns:
        long value
      • latest

        public long latest()
        Description copied from interface: Load
        Obtain the latest bytes counter viewed on that link.
        Specified by:
        latest in interface Load
        Returns:
        long value
      • isValid

        public boolean isValid()
        Description copied from interface: Load
        Indicates whether this load was built on valid values.
        Specified by:
        isValid in interface Load
        Returns:
        boolean
      • time

        public long time()
        Description copied from interface: Load
        Returns when this value was seen.
        Specified by:
        time in interface Load
        Returns:
        epoch time