Class CeilometerMetricStreamDefinition


  • public class CeilometerMetricStreamDefinition
    extends java.lang.Object
    Describes what query to run for this particular Ceilometer MetricStream.
    See Also:
    CeilometerMetricStreamerConfig
    • 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)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      com.elastisys.scale.commons.json.types.TimeInterval getDataSettlingTime()
      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.String getId()
      Returns the id of the metric stream.
      java.lang.String getMeter()
      The particular Ceilometer meter to query.
      com.elastisys.scale.commons.json.types.TimeInterval getQueryChunkSize()
      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.
      int hashCode()  
      boolean isConvertToRate()
      When true the stream will feed the change rate of the metric rather than the absolute values of the metric.
      java.lang.String toString()  
      void validate()
      Validates that this CeilometerMetricStreamDefinition contains sufficient information to allow a valid Ceilometer meter query to be built.
      CeilometerMetricStreamDefinition withDownsampling​(Downsampling downsampling)
      Returns a copy of this object with the downsampling field replaced by the given value.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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)
        Parameters:
        id - The id of the metric stream. This is the id that will be used by clients wishing to subscribe to MetricValues 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 be null.
        downsampling - A downsampling specification which can be set to query for statistics rather than raw samples. May be null which means samples will be collected for the given meter.
        convertToRate - When true the 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 be null. Default is DEFAULT_RATE_CONVERSION.
        dataSettlingTime - The minimum age of requested data points. The MetricStreamer will 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 about 1.5 times the length of the reporting-interval for monitoring agents. May be null.

        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 large QueryResultSets limits the amount of (memory) resources involved in processing large queries. May be null. 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 to MetricValues 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 be null.
        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()
        When true the 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. The MetricStreamer will 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 large QueryResultSets limits the amount of (memory) resources involved in processing large queries.
        Returns:
      • validate

        public void validate()
                      throws java.lang.IllegalArgumentException
        Validates that this CeilometerMetricStreamDefinition contains 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, an IllegalArgumentException is thrown.
        Throws:
        java.lang.IllegalArgumentException
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object