org.rhq.enterprise.server.measurement.util
Class MeasurementUtils

java.lang.Object
  extended by org.rhq.enterprise.server.measurement.util.MeasurementUtils

public class MeasurementUtils
extends Object


Field Summary
static int UNIT_COLLECTION_POINTS
           
static int UNIT_DAYS
           
static int UNIT_HOURS
           
static int UNIT_MINUTES
           
static int UNIT_WEEKS
           
 
Constructor Summary
MeasurementUtils()
           
 
Method Summary
static List<Long> calculateTimeFrame(int lastN, int unit)
          Method calculateTimeFrame

Returns a two elementList of Long objects representing the begin and end times (in milliseconds since the epoch) of the timeframe.

static org.rhq.core.domain.measurement.ui.MetricDisplaySummary parseMetricToken(String token)
          Parse the passed token that identifies single metric or group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNIT_COLLECTION_POINTS

public static final int UNIT_COLLECTION_POINTS
See Also:
Constant Field Values

UNIT_MINUTES

public static final int UNIT_MINUTES
See Also:
Constant Field Values

UNIT_HOURS

public static final int UNIT_HOURS
See Also:
Constant Field Values

UNIT_DAYS

public static final int UNIT_DAYS
See Also:
Constant Field Values

UNIT_WEEKS

public static final int UNIT_WEEKS
See Also:
Constant Field Values
Constructor Detail

MeasurementUtils

public MeasurementUtils()
Method Detail

calculateTimeFrame

public static List<Long> calculateTimeFrame(int lastN,
                                            int unit)
Method calculateTimeFrame

Returns a two elementList of Long objects representing the begin and end times (in milliseconds since the epoch) of the timeframe. Returns null instead if the time unit is indicated as UNIT_COLLECTION_POINTS.

Parameters:
lastN - the number of time units in the time frame
unit - the unit of time (as defined by UNIT_* constants
Returns:
List

parseMetricToken

public static org.rhq.core.domain.measurement.ui.MetricDisplaySummary parseMetricToken(String token)
Parse the passed token that identifies single metric or group. The format of the token is (without quotation marks):

Parameters:
token - A token that follows the form mentioned above.
Returns:
a new MetricDisplaySummary where the identifiers for resource/group have been set.
See Also:
#getContextKeyChart(MetricDisplaySummary)


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