Package io.roastedroot.proxywasm
Enum MetricType
- java.lang.Object
-
- java.lang.Enum<MetricType>
-
- io.roastedroot.proxywasm.MetricType
-
- All Implemented Interfaces:
Serializable
,Comparable<MetricType>
public enum MetricType extends Enum<MetricType>
Represents the types of metrics that can be defined and manipulated via the Proxy-WASM ABI.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MetricType
fromInt(int value)
Convert an integer value to its corresponding MetricType enum constant.int
getValue()
Get the integer value of this metric type as defined by the Proxy-WASM ABI.static MetricType
valueOf(String name)
Returns the enum constant of this type with the specified name.static MetricType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
COUNTER
public static final MetricType COUNTER
A metric that only increments. Value: 0
-
GAUGE
public static final MetricType GAUGE
A metric that can be arbitrarily set. Value: 1
-
HISTOGRAM
public static final MetricType HISTOGRAM
A metric that accumulates observations into predefined buckets and a sum of observations. Value: 2
-
-
Method Detail
-
values
public static MetricType[] 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 (MetricType c : MetricType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MetricType 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
-
getValue
public int getValue()
Get the integer value of this metric type as defined by the Proxy-WASM ABI.- Returns:
- The integer value representing the metric type.
-
fromInt
public static MetricType fromInt(int value)
Convert an integer value to its corresponding MetricType enum constant.- Parameters:
value
- The integer value to convert.- Returns:
- The corresponding MetricType enum constant, or
null
if the provided integer value does not match any known MetricType.
-
-