adjusting.availability_adjusting
Class FailureTrace
java.lang.Object
adjusting.availability_adjusting.FailureTrace
- All Implemented Interfaces:
- java.io.Serializable
public class FailureTrace
- extends java.lang.Object
- implements java.io.Serializable
This class resembles the periods of time that a Server object should be
artificially failed in them. For example: [12:01 - 12:03] , [ 14:05 - 14:10 ] , [
18:23: 18:33] is a trace meaning that the server in subject will be
unavailable or failed in the times 12:01 to 12:03, 14:05 to 14:10 and 18:23
to 18:33.
- Author:
- Majd Kokaly
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FailureTrace
public FailureTrace()
getFailurePeriods
public java.util.ArrayList<FailurePeriod> getFailurePeriods()
setFailurePeriods
public void setFailurePeriods(java.util.ArrayList<FailurePeriod> failingPeriods)
getNumbersOfPeriods
public int getNumbersOfPeriods()
getMeanOfPeriodsInMinutes
public double getMeanOfPeriodsInMinutes()
- Returns:
- the mean of the lengths of all the FailurePeriod objects in this
trace. (length: is endTime - beginingTime)
getMeanIfInterPeriodsInMinutes
public double getMeanIfInterPeriodsInMinutes()
- Returns:
- the mean of the lengths of periods between artificial periods.
(i.e mean of up-time periods)
add
public boolean add(FailurePeriod period)
- Parameters:
period
- is FailurePeriod Object
- Returns:
- true if addition succeeded, false otherwise. Additions might fail
if the to be added period overlaps an existing
FailurePeriod
print
public void print()
IsTimeInFailure
public boolean IsTimeInFailure(java.util.GregorianCalendar time)
- Parameters:
time
- is a GregorianCalendar (i.e time object)
- Returns:
- true if time is in any FailurePeriod object in this trace and
false otherwise.
getEndOfFailure
public java.util.GregorianCalendar getEndOfFailure(java.util.GregorianCalendar time)
- Parameters:
time
- Calendar object
- Returns:
- the end of the failure period that cal is in. If cal is not in
any failure period, null is returned.
doesPeriodOverlapAFailurePeriod
public boolean doesPeriodOverlapAFailurePeriod(FailurePeriod period)
- Parameters:
period
- is a FailurePeriod object.
- Returns:
- true if period overlaps with some FailurePeriod object in this
trace, false otherwise.
doesRangeOverlapAFailurePeriod
public boolean doesRangeOverlapAFailurePeriod(java.util.GregorianCalendar startTime,
java.util.GregorianCalendar endTime)
- Parameters:
startTime
- is a TimeendTime
- is a Time
- Returns:
- true if time range between startTime and endTime overlaps with some FailurePeriod object in this
trace, false otherwise.
fillTrace
public void fillTrace(java.util.GregorianCalendar startTime,
java.util.GregorianCalendar endTime,
double periodLengthMean,
double interPeriodLengthMean,
double minutesInTimeUnit)
- This method fills a trace of failure periods.
- Parameters:
startTime
- the start time of the traceendTime
- The end time of the traceperiodLengthMean
- the mean of all the periods lengthsinterPeriodLengthMean
- the mean between the periods of failuresminutesInTimeUnit
- the minutes per Time Unit of the system