Package com.wavefront.agent.histogram
Enum Granularity
- java.lang.Object
-
- java.lang.Enum<Granularity>
-
- com.wavefront.agent.histogram.Granularity
-
- All Implemented Interfaces:
Serializable
,Comparable<Granularity>
public enum Granularity extends Enum<Granularity>
Standard supported aggregation Granularities. Refactored from HistogramUtils.- Author:
- Tim Schmidt ([email protected]), [email protected]
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Granularity
fromMillis(long millis)
int
getBinId(long timeMillis)
Bin id for an epoch time is the epoch time in the corresponding granularity.int
getInMillis()
Duration of a corresponding bin in milliseconds.String
toString()
static Granularity
valueOf(String name)
Returns the enum constant of this type with the specified name.static Granularity[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
MINUTE
public static final Granularity MINUTE
-
HOUR
public static final Granularity HOUR
-
DAY
public static final Granularity DAY
-
-
Method Detail
-
values
public static Granularity[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Granularity c : Granularity.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Granularity valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getInMillis
public int getInMillis()
Duration of a corresponding bin in milliseconds.- Returns:
- bin length in milliseconds
-
getBinId
public int getBinId(long timeMillis)
Bin id for an epoch time is the epoch time in the corresponding granularity.- Parameters:
timeMillis
- epoch time in milliseconds- Returns:
- the bin id
-
toString
public String toString()
- Overrides:
toString
in classEnum<Granularity>
-
fromMillis
public static Granularity fromMillis(long millis)
-
-