com.ibm.wsspi.usage.metering

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. "AVAILABLE_PROCESSORS")
        • names - translated display names in a map of language to translated name (e.g. "en", "Available Processors")
        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().
      • 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", "Available Processors").
      • 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)

      • 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)

      • 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)

      • 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)

      • 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)

        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)

        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)

        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)

        Returns:
        a reference to this object
      • getName

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

        Default : null

      • setName

        public MetricDescriptor setName(java.lang.String name)
        Sets the untranslated name
        Parameters:
        name - the name to set
      • getUnits

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

        Default : null

      • setUnits

        public MetricDescriptor setUnits(java.lang.String units)
        Sets the untranslated units
        Parameters:
        units - the units to set
      • 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
      • getConcurrentDurationCap

        public java.lang.Number getConcurrentDurationCap()
        Returns:
        the concurrentDurationCap
      • setConcurrentDurationCap

        public void setConcurrentDurationCap(java.lang.Number concurrentDurationCap)
        Parameters:
        concurrentDurationCap - the concurrentDurationCap to set
      • getSharedDurationCap

        public java.lang.Number getSharedDurationCap()
        Returns:
        the sharedDurationCap
      • setSharedDurationCap

        public void setSharedDurationCap(java.lang.Number sharedDurationCap)
        Parameters:
        sharedDurationCap - the sharedDurationCap to set