Interface MetricQueryBuilder


  • public interface MetricQueryBuilder
    Since:
    2019.2
    Author:
    kir
    • Method Detail

      • withExperimental

        @NotNull
        MetricQueryBuilder withExperimental​(boolean returnExperimental)
        Parameters:
        returnExperimental - if true, experimental metrics will be returned as well
      • namePart

        @NotNull
        MetricQueryBuilder namePart​(@NotNull
                                    String namePart)
        Parameters:
        namePart - Part of the metric name to be returned
      • addTag

        MetricQueryBuilder addTag​(String tagName,
                                  String tagValue)
        Add to the query the tag with given name and given value. Can be called several times for the same tagName. In this case, any of the provided `tagValue` will match the `build` query.
        Parameters:
        tagName -
        tagValue -
        Returns:
        query builder
      • build

        @NotNull
        List<MetricValue> build()
        Returns:
        all metric values which fit the current builder conditions
      • getMetricValue

        @Nullable
        MetricValue getMetricValue​(@NotNull
                                   String metricName,
                                   @NotNull
                                   Map<String,​String> nonCommonTags,
                                   boolean experimental)
        Return a metric value for a specified metric by name and tags, should be a fast operation. For this call, only one value for a requested tag is supported, i.e. if you cannot this builder with multiple `addTag` calls for the same tagName.
        Parameters:
        metricName - name in the format "foo.bar" as when metric was created
        nonCommonTags - set of tags for this metric
        experimental - true if the metric was marked experimental, false otherwise, it is translated into 'experimental' tag.
        Returns:
        see above