Class CeilometerMetricStreamDefinition
- java.lang.Object
-
- com.elastisys.autoscaler.metricstreamers.ceilometer.config.CeilometerMetricStreamDefinition
-
public class CeilometerMetricStreamDefinition extends java.lang.ObjectDescribes what query to run for this particular CeilometerMetricStream.- See Also:
CeilometerMetricStreamerConfig
-
-
Field Summary
Fields Modifier and Type Field Description static com.elastisys.scale.commons.json.types.TimeIntervalDEFAULT_DATA_SETTLING_TIMEstatic com.elastisys.scale.commons.json.types.TimeIntervalDEFAULT_QUERY_CHUNK_SIZEstatic java.lang.BooleanDEFAULT_RATE_CONVERSION
-
Constructor Summary
Constructors Constructor Description CeilometerMetricStreamDefinition(java.lang.String id, java.lang.String meter, java.lang.String resourceId, Downsampling downsampling, java.lang.Boolean convertToRate, com.elastisys.scale.commons.json.types.TimeInterval dataSettlingTime, com.elastisys.scale.commons.json.types.TimeInterval queryChunkSize)Constructs a newCeilometerMetricStreamDefinition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)com.elastisys.scale.commons.json.types.TimeIntervalgetDataSettlingTime()The minimum age of requested data points.java.util.Optional<Downsampling>getDownsampling()A downsampling specification which can be set to query for statistics rather than raw samples.java.lang.StringgetId()Returns the id of the metric stream.java.lang.StringgetMeter()The particular Ceilometer meter to query.com.elastisys.scale.commons.json.types.TimeIntervalgetQueryChunkSize()The maximum time period that a single query will attempt to fetch in a single call.java.util.Optional<java.lang.String>getResourceId()A resource identifier which can be used narrow down the query to only retrieve metric values associated with a given OpenStack resource.inthashCode()booleanisConvertToRate()Whentruethe stream will feed the change rate of the metric rather than the absolute values of the metric.java.lang.StringtoString()voidvalidate()Validates that thisCeilometerMetricStreamDefinitioncontains sufficient information to allow a valid Ceilometer meter query to be built.CeilometerMetricStreamDefinitionwithDownsampling(Downsampling downsampling)Returns a copy of this object with thedownsamplingfield replaced by the given value.
-
-
-
Field Detail
-
DEFAULT_RATE_CONVERSION
public static final java.lang.Boolean DEFAULT_RATE_CONVERSION
-
DEFAULT_DATA_SETTLING_TIME
public static final com.elastisys.scale.commons.json.types.TimeInterval DEFAULT_DATA_SETTLING_TIME
-
DEFAULT_QUERY_CHUNK_SIZE
public static final com.elastisys.scale.commons.json.types.TimeInterval DEFAULT_QUERY_CHUNK_SIZE
-
-
Constructor Detail
-
CeilometerMetricStreamDefinition
public CeilometerMetricStreamDefinition(java.lang.String id, java.lang.String meter, java.lang.String resourceId, Downsampling downsampling, java.lang.Boolean convertToRate, com.elastisys.scale.commons.json.types.TimeInterval dataSettlingTime, com.elastisys.scale.commons.json.types.TimeInterval queryChunkSize)Constructs a newCeilometerMetricStreamDefinition.- Parameters:
id- The id of the metric stream. This is the id that will be used by clients wishing to subscribe toMetricValues for this metric stream. Required.meter- The particular Ceilometer meter to query. Required.resourceId- A resource identifier which can be used narrow down the query to only retrieve metric values associated with a given OpenStack resource. May benull.downsampling- A downsampling specification which can be set to query for statistics rather than raw samples. May benullwhich means samples will be collected for the given meter.convertToRate- Whentruethe stream will feed the change rate of the metric rather than the absolute values of the metric. This is useful if the meter represents a cumulative metric. May benull. Default isDEFAULT_RATE_CONVERSION.dataSettlingTime- The minimum age of requested data points. TheMetricStreamerwill never request values newer than this from Ceilometer. This value can be regarded as the expected "settling time" of new data points. When requesting recent aggregate metric data points, there is always a risk of seeing partial/incomplete results before metric values from all sources have been registered. The data settling time is intended to give all sources a chance to report before fetching recent values. The value to set for this field depends on the reporting frequency of monitoring agents, but as a general rule-of-thumb, this value can be set to be about1.5times the length of the reporting-interval for monitoring agents. May benull.queryChunkSize- The maximum time period that a single query will attempt to fetch in a single call. A query with a longer time interval will be run incrementally, each fetching a sub-interval of this duration. This type of incremental retrieval of largeQueryResultSets limits the amount of (memory) resources involved in processing large queries. May benull. Default: .
-
-
Method Detail
-
getId
public java.lang.String getId()
Returns the id of the metric stream. This is the id that will be used by clients wishing to subscribe toMetricValues for this metric stream.- Returns:
-
getMeter
public java.lang.String getMeter()
The particular Ceilometer meter to query.- Returns:
-
getResourceId
public java.util.Optional<java.lang.String> getResourceId()
A resource identifier which can be used narrow down the query to only retrieve metric values associated with a given OpenStack resource. May benull.- Returns:
-
getDownsampling
public java.util.Optional<Downsampling> getDownsampling()
A downsampling specification which can be set to query for statistics rather than raw samples. An absent value means that samples will be collected for the given meter rather than "statistics".- Returns:
-
isConvertToRate
public boolean isConvertToRate()
Whentruethe stream will feed the change rate of the metric rather than the absolute values of the metric.- Returns:
-
getDataSettlingTime
public com.elastisys.scale.commons.json.types.TimeInterval getDataSettlingTime()
The minimum age of requested data points. TheMetricStreamerwill never request values newer than this from Ceilometer. This value can be regarded as the expected "settling time" of new data points. When requesting recent aggregate metric data points, there is always a risk of seeing partial/incomplete results before metric values from all sources have been registered. The data settling time is intended to give all sources a chance to report before fetching recent values.- Returns:
-
getQueryChunkSize
public com.elastisys.scale.commons.json.types.TimeInterval getQueryChunkSize()
The maximum time period that a single query will attempt to fetch in a single call. A query with a longer time interval will be run incrementally, each fetching a sub-interval of this duration. This type of incremental retrieval of largeQueryResultSets limits the amount of (memory) resources involved in processing large queries.- Returns:
-
validate
public void validate() throws java.lang.IllegalArgumentExceptionValidates that thisCeilometerMetricStreamDefinitioncontains sufficient information to allow a valid Ceilometer meter query to be built. If it does, the method will just return. If it is found to be invalid, anIllegalArgumentExceptionis thrown.- Throws:
java.lang.IllegalArgumentException
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
withDownsampling
public CeilometerMetricStreamDefinition withDownsampling(Downsampling downsampling)
Returns a copy of this object with thedownsamplingfield replaced by the given value.- Parameters:
downsampling-- Returns:
-
-