Class OutageSvcTimesList

    • Constructor Detail

      • OutageSvcTimesList

        public OutageSvcTimesList()
        Default constructor
        See Also:
        ArrayList()
      • OutageSvcTimesList

        public OutageSvcTimesList​(int initialCapacity)
        Constructor
        Parameters:
        initialCapacity - a int.
        See Also:
        ArrayList(int initCapacity)
    • Method Detail

      • addSvcTime

        public void addSvcTime​(long losttime,
                               long regainedtime)
        Add a new servicetime entry
        Parameters:
        losttime - time at which service was lost
        regainedtime - time at which service was regained
      • addSvcTime

        public void addSvcTime​(long losttime)
        Add a new service time entry
        Parameters:
        losttime - time at which service was lost
      • getDownTime

        public long getDownTime​(long curTime,
                                long rollingWindow)
        Calculate the total downtime in this list of service times for the last 'rollinWindow' time starting at 'curTime'
        Parameters:
        curTime - the current time from which the down time is to be calculated
        rollingWindow - the last window for which the downtime is to be calculated
        Returns:
        total down time in service times in this list
      • getServiceOutages

        public List<OutageSince> getServiceOutages​(String nodeName,
                                                   long curTime,
                                                   long rollingWindow)
        Returns a list of outage / out-since pairs for the rolling window specified
        Parameters:
        curTime - the current time from which the down time is to be calculated
        rollingWindow - the last window for which the down time is to be calculated
        nodeName - a String object.
        Returns:
        a List object.