Class MetricOptions.Builder

    • Constructor Detail

      • Builder

        Builder()
    • Method Detail

      • setDescription

        public abstract MetricOptions.Builder setDescription​(java.lang.String description)
        Sets the description of the Metric.
        Parameters:
        description - the description of the Metric.
        Returns:
        this.
        Since:
        0.20
      • setUnit

        public abstract MetricOptions.Builder setUnit​(java.lang.String unit)
        Sets the unit of the Metric.
        Parameters:
        unit - the unit of the Metric.
        Returns:
        this.
        Since:
        0.20
      • setLabelKeys

        public abstract MetricOptions.Builder setLabelKeys​(java.util.List<LabelKey> labelKeys)
        Sets the list of label keys for the Metric.
        Parameters:
        labelKeys - the list of label keys for the Metric.
        Returns:
        this.
        Since:
        0.20
      • setConstantLabels

        public abstract MetricOptions.Builder setConstantLabels​(java.util.Map<LabelKey,​LabelValue> constantLabels)
        Sets the map of constant labels (they will be added to all the TimeSeries) for the Metric.
        Parameters:
        constantLabels - the map of constant labels for the Metric.
        Returns:
        this.
        Since:
        0.21
      • getLabelKeys

        abstract java.util.List<LabelKey> getLabelKeys()
      • build

        public MetricOptions build()
        Builds and returns a MetricOptions with the desired options.
        Returns:
        a MetricOptions with the desired options.
        Throws:
        java.lang.NullPointerException - if description, OR unit is null, OR labelKeys is null OR any element of labelKeys is null, OR OR constantLabels is null OR any element of constantLabels is null.
        java.lang.IllegalArgumentException - if any LabelKey from the labelKeys is in the constantLabels.
        Since:
        0.20