Class MetricDescriptor

    • Constructor Detail

      • MetricDescriptor

        public MetricDescriptor​(java.lang.String type,
                                java.util.Map<java.lang.String,​java.lang.String> translatedNames)
        Constructs a MetricDescriptor with all required descriptor attributes. Optional attributes should be provided by calling set methods.

        A MetricDescriptor must provide the following attributes:

        • type - unique identifier for the metric (e.g. "PROCESSOR_CORES")
        • names - translated display names in a map of language to translated name (e.g. "en", "Processor Cores")
        Parameters:
        type - unique identifier for the metric
        translatedNames - translated display names for the metric
    • Method Detail

      • getType

        public java.lang.String getType()
        Returns the unique identifier for the metric. This corresponds to the value reported on Metric.getMetricType().
        Returns:
        the unique identifier for the metric
      • getTranslatedNames

        public java.util.Map<java.lang.String,​java.lang.String> getTranslatedNames()
        Returns the translated display names as a map where the key is the language and the value is the translated name of the metric (e.g. "en", "Processor Cores").
        Returns:
        the translated display names
      • getTranslatedUnits

        public java.util.Map<java.lang.String,​java.lang.String> getTranslatedUnits()
        Returns the translated display units as a map where the key is the language and the value is the translated unit of the metric (e.g. "en", "seconds"), or null if units should not be displayed for the metric.

        Default : null (no units displayed)

        Returns:
        the translated display units
      • getDefaultValue

        public java.lang.Number getDefaultValue()
        Returns the value used in intervals where usage data is not sent (e.g. because the server is stopped), or null if a default should not be used.

        Default : null (default value not used)

        Returns:
        the value used in intervals where usage data is not sent
      • getMinValue

        public java.lang.Number getMinValue()
        Returns the minimum value, for shaping Y axis in charts, or gauges (e.g. 0 for percent values).

        Default : null (shape based on reported values)

        Returns:
        the minimum value
      • getMaxValue

        public java.lang.Number getMaxValue()
        Returns the maximum value, for shaping Y axis in charts, or gauges (e.g. 100 for percent values)

        Default : null (shape based on reported values)

        Returns:
        the maximum value
      • setTranslatedUnits

        public MetricDescriptor setTranslatedUnits​(java.util.Map<java.lang.String,​java.lang.String> translatedUnits)
        Sets the translated display units as a map where the key is the language and the value is the translated unit of the metric (e.g. "en", "seconds"), or null if units should not be displayed for the metric.

        Default : null (no units displayed)

        Parameters:
        translatedUnits - the translated display units
        Returns:
        a reference to this object
      • setDefaultValue

        public MetricDescriptor setDefaultValue​(java.lang.Number defaultValue)
        Sets the value used in intervals where usage data is not sent (e.g. because the server is stopped), or null if a default should not be used.

        Default : null (default value not used)

        Parameters:
        defaultValue - the value used in intervals where usage data is not sent
        Returns:
        a reference to this object
      • setMinValue

        public MetricDescriptor setMinValue​(java.lang.Number minValue)
        Sets the minimum value, for shaping Y axis in charts, or gauges (e.g. 0 for percent values).

        Default : null (shape based on reported values)

        Parameters:
        minValue - the minimum value
        Returns:
        a reference to this object
      • setMaxValue

        public MetricDescriptor setMaxValue​(java.lang.Number maxValue)
        Sets the maximum value, for shaping Y axis in charts, or gauges (e.g. 100 for percent values)

        Default : null (shape based on reported values)

        Parameters:
        maxValue - the maximum value
        Returns:
        a reference to this object
      • getName

        public java.lang.String getName()
        Returns the untranslated name

        Default : null

        Returns:
        the untranslated name
      • setName

        public MetricDescriptor setName​(java.lang.String name)
        Sets the untranslated name
        Parameters:
        name - the name to set
        Returns:
        a reference to this object
      • getUnits

        public java.lang.String getUnits()
        Returns the untranslated units

        Default : null

        Returns:
        the untranslated units
      • setUnits

        public MetricDescriptor setUnits​(java.lang.String units)
        Sets the untranslated units
        Parameters:
        units - the units to set
        Returns:
        a reference to this object
      • 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