org.rhq.enterprise.server.measurement.util
Class MeasurementUtils
java.lang.Object
org.rhq.enterprise.server.measurement.util.MeasurementUtils
public class MeasurementUtils
- extends Object
|
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 |
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
MeasurementUtils
public MeasurementUtils()
calculateTimeFrame
public static List<Long> calculateTimeFrame(int lastN,
int unit)
- Method calculateTimeFrame
Returns a two element
List 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 frameunit - 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):
- For a compatible group: "cg,groupId,definitionId"
- For an autogroup : "ag,parentId,definitionId,childTypeId"
- For a single resource: "resourceId,scheduleId"
- 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.