public class OutageSvcTimesList extends ArrayList<Outage>
This contains a list of service lost/regained set/pair. Also maintains the outage/down time each time it is calculated and the time from which this was calculated - this is done so when the view outage time for a window is calculated, the same calculations are not done on the node multiple times
modCount
Constructor and Description |
---|
OutageSvcTimesList()
Default constructor
|
OutageSvcTimesList(int initialCapacity)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addSvcTime(long losttime)
Add a new service time entry
|
void |
addSvcTime(long losttime,
long regainedtime)
Add a new servicetime entry
|
long |
getDownTime(long curTime,
long rollingWindow)
Calculate the total downtime in this list of service times for the last
'rollinWindow' time starting at 'curTime'
|
List<OutageSince> |
getServiceOutages(String nodeName,
long curTime,
long rollingWindow)
Returns a list of outage / out-since pairs for the rolling window
specified
|
String |
toString()
toString
|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
equals, hashCode
containsAll
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode
parallelStream, stream
public OutageSvcTimesList()
ArrayList.ArrayList()
public OutageSvcTimesList(int initialCapacity)
initialCapacity
- a int.ArrayList.ArrayList(int initCapacity)
public void addSvcTime(long losttime, long regainedtime)
losttime
- time at which service was lostregainedtime
- time at which service was regainedpublic void addSvcTime(long losttime)
losttime
- time at which service was lostpublic long getDownTime(long curTime, long rollingWindow)
curTime
- the current time from which the down time is to be calculatedrollingWindow
- the last window for which the downtime is to be calculatedpublic List<OutageSince> getServiceOutages(String nodeName, long curTime, long rollingWindow)
public String toString()
toString
toString
in class AbstractCollection<Outage>
String
object.Copyright © 2020. All rights reserved.