org.rhq.enterprise.server.util
Class TimingVoodoo

java.lang.Object
  extended by org.rhq.enterprise.server.util.TimingVoodoo

public final class TimingVoodoo
extends Object

This helper class is full of "voodoo" functions related to synchronizing timed data between the agent and the server. We call them "voodoo" because they deal mostly with rounding down and guestimating percentages.


Constructor Summary
TimingVoodoo()
           
 
Method Summary
static long closestTime(long approxTime, long interval)
          Given the approximate time associated with a data point and the interval at which that data point is being collected, compute the exact data point to which the data point corresponds.
static long roundDownTime(long approxTime, long interval)
          Given the approximate time associated with a data point and the interval at which that data point is being collected, compute the exact data point to which the data point corresponds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimingVoodoo

public TimingVoodoo()
Method Detail

roundDownTime

public static long roundDownTime(long approxTime,
                                 long interval)
Given the approximate time associated with a data point and the interval at which that data point is being collected, compute the exact data point to which the data point corresponds.

Parameters:
approxTime - the approximate time to which the data point corresponds
interval - the collection interval
Returns:
the time, rounded down to the previous collection interval

closestTime

public static long closestTime(long approxTime,
                               long interval)
Given the approximate time associated with a data point and the interval at which that data point is being collected, compute the exact data point to which the data point corresponds.

Parameters:
approxTime - the approximate time to which the data point corresponds
interval - the collection interval
Returns:
the time, rounded up or down to the closest collection interval


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