org.rhq.core.domain.resource.composite
Class ResourceAvailabilitySummary

java.lang.Object
  extended by org.rhq.core.domain.resource.composite.ResourceAvailabilitySummary
All Implemented Interfaces:
Serializable

public class ResourceAvailabilitySummary
extends Object
implements Serializable

Summary information about a resource's availability history

See Also:
Serialized Form

Constructor Summary
protected ResourceAvailabilitySummary()
           
  ResourceAvailabilitySummary(List<Availability> availabilities)
           
  ResourceAvailabilitySummary(long now, long upTime, long downTime, long disabledTime, long unknownTime, int failures, int disabled, long lastChange, AvailabilityType current)
           
 
Method Summary
 AvailabilityType getCurrent()
           
 long getCurrentTime()
          Returns the "current time" which is actually the time that was current at the time when this object was created.
 int getDisabled()
          Returns the number of discrete times the availability flipped to DISABLED.
 double getDisabledPercentage()
          Returns the percentage of time the availability has been DISABLED.
 long getDisabledTime()
          Returns the time the availability has been DISABLED in milliseconds.
 double getDownPercentage()
          Returns the percentage of time the availability has been DOWN.
 long getDownTime()
          Returns the time the availability has been DOWN in milliseconds.
 int getFailures()
          Returns the number of discrete times the availability went DOWN, which is considered a failure.
 long getKnownTime()
          Returns the time the availability was in a known state (which includes UP, DOWN and DISABLED).
 Date getLastChange()
           
 long getMTBF()
          Returns the mean-time-between-failures metric.
 long getMTTR()
          Returns the mean-time-to-repair metric.
 long getUnknownTime()
          Returns the time the availability has been UNKNOWN in milliseconds.
 double getUpPercentage()
          Returns the percentage of time the availability has been UP.
 long getUpTime()
          Returns the time the availability has been UP in milliseconds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceAvailabilitySummary

public ResourceAvailabilitySummary(List<Availability> availabilities)

ResourceAvailabilitySummary

public ResourceAvailabilitySummary(long now,
                                   long upTime,
                                   long downTime,
                                   long disabledTime,
                                   long unknownTime,
                                   int failures,
                                   int disabled,
                                   long lastChange,
                                   AvailabilityType current)

ResourceAvailabilitySummary

protected ResourceAvailabilitySummary()
Method Detail

getMTBF

public long getMTBF()
Returns the mean-time-between-failures metric. The computation only takes into account the uptimes and downtimes. Any time periods of UNKNOWN or DISABLED availability are ignored. If there has been no failures yet, or there has only been one failure, the MTBF cannot be calculated - in this case, 0 is returned.

Returns:
MTBF value in milliseconds

getMTTR

public long getMTTR()
Returns the mean-time-to-repair metric. The computation only takes into account the uptimes and downtimes. Any time periods of UNKNOWN or DISABLED availability are ignored. If there has been no failures yet, the MTTR cannot be calculated - in this case, 0 is returned.

Returns:
MTTR value in milliseconds

getUpPercentage

public double getUpPercentage()
Returns the percentage of time the availability has been UP. For the purposes of this calculation, a DISABLED time period explicitly counts as a "non-UP" time period. This ignores any time periods of UNKNOWN availability.

Returns:
uptime percentage

getUpTime

public long getUpTime()
Returns the time the availability has been UP in milliseconds. For the purposes of this calculation, only the times that UP was the explicit state are used (that is, DOWN, DISABLED and UNKNOWN time periods are excluded from the returned cumulative uptime).

Returns:
cumulative uptime in milliseconds

getDownPercentage

public double getDownPercentage()
Returns the percentage of time the availability has been DOWN. For the purposes of this calculation, a DISABLED time period is not considered DOWN. This ignores any time periods of UNKNOWN availability.

Returns:
downtime percentage

getDownTime

public long getDownTime()
Returns the time the availability has been DOWN in milliseconds. For the purposes of this calculation, only the times that DOWN was the explicit state are used (that is, UP, DISABLED and UNKNOWN time periods are excluded from the returned cumulative downtime).

Returns:
cumulative downtime in milliseconds

getDisabledPercentage

public double getDisabledPercentage()
Returns the percentage of time the availability has been DISABLED. This ignores any time periods of UNKNOWN availability.

Returns:
percentage of time availability was disabled

getDisabledTime

public long getDisabledTime()
Returns the time the availability has been DISABLED in milliseconds.

Returns:
cumulative time in disabled state, in milliseconds

getUnknownTime

public long getUnknownTime()
Returns the time the availability has been UNKNOWN in milliseconds.

Returns:
cumulative time the availability was unknown, in milliseconds

getKnownTime

public long getKnownTime()
Returns the time the availability was in a known state (which includes UP, DOWN and DISABLED). This obviously does not include the times which the availability was in the UNKNOWN state.

Returns:
cumulative time the availability was known, in milliseconds

getFailures

public int getFailures()
Returns the number of discrete times the availability went DOWN, which is considered a failure.

Returns:
count of the number of failures

getDisabled

public int getDisabled()
Returns the number of discrete times the availability flipped to DISABLED.

Returns:
count of the number of times availability was disabled

getLastChange

public Date getLastChange()

getCurrent

public AvailabilityType getCurrent()

getCurrentTime

public long getCurrentTime()
Returns the "current time" which is actually the time that was current at the time when this object was created.

Returns:
the "current time" when this object was created


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.