Interface Metrics.TopicMetricCollector.Builder

All Superinterfaces:
Metrics.Builder<Metrics.TopicMetricCollector.Builder>
Enclosing interface:
Metrics.TopicMetricCollector

public static interface Metrics.TopicMetricCollector.Builder extends Metrics.Builder<Metrics.TopicMetricCollector.Builder>
A topic metric collector builder.

A builder of this type may be created using newTopicMetricCollectorBuilder and used to create instances of Metrics.TopicMetricCollector that can be supplied to putTopicMetricCollector.

  • Method Details

    • groupByTopicType

      Metrics.TopicMetricCollector.Builder groupByTopicType(boolean groupByTopicType)
      Specifies whether the metric collector should group by topic type.

      By default a topic metric collector does not group by topic type.

      Parameters:
      groupByTopicType - true to indicate that the collector should group by topic type
      Returns:
      this builder
    • groupByPathPrefixParts

      Metrics.TopicMetricCollector.Builder groupByPathPrefixParts(int parts)
      Specifies the number of leading parts of the topic path the metric collector should use to group results.

      By default a topic metric collector does not group by the topic path prefix. If a positive number of parts is specified, it will enable grouping.

      Parameters:
      parts - the number of leading parts of the topic path to group by; set to 0 to disable grouping by path
      Returns:
      this builder
      Since:
      6.8
    • groupByTopicView

      Metrics.TopicMetricCollector.Builder groupByTopicView(boolean groupByTopicView)
      Specifies whether the metric collector should group by topic view.

      By default a topic metric collector does not group by topic view.

      Parameters:
      groupByTopicView - true to indicate that the collector should group by topic view
      Returns:
      this builder
      Since:
      6.9
    • create

      Metrics.TopicMetricCollector create(String name, String topicSelector)
      Create a new Metrics.TopicMetricCollector using the values currently known to this builder.
      Parameters:
      name - the name of the Metrics.TopicMetricCollector
      topicSelector - the selector pattern that specifies the topics for which metrics are to be collected
      Returns:
      a new Metrics.TopicMetricCollector with all of the current settings of this builder
      Throws:
      IllegalArgumentException - if this builder has been configured using groupByPathPrefixParts(int) and a negative number of parts