Class AggregatingEmitter

java.lang.Object
io.confluent.telemetry.emitter.AggregatingEmitter
All Implemented Interfaces:
Emitter

public class AggregatingEmitter extends Object implements Emitter
Wraps an Emitter with aggregation capability.

This emitter is stateful and must be freshly created each collection cycle.

  • Constructor Details

    • AggregatingEmitter

      public AggregatingEmitter(Set<io.confluent.telemetry.config.v2.AggregationRule> aggregationRule, Emitter delegate)
  • Method Details

    • shouldEmitMetric

      public boolean shouldEmitMetric(Keyed key)
      Description copied from interface: Emitter
      Tests whether this metric object could actually be emitted based on its key. This is useful when materializing the metric object is an expensive operation.
      Specified by:
      shouldEmitMetric in interface Emitter
      Parameters:
      key - metric key to test against
      Returns:
      true if it is possible for this object to get emitted, false otherwise
    • emitMetric

      public boolean emitMetric(SinglePointMetric metric)
      Description copied from interface: Emitter
      Emits a metric to all configured Exporter objects.
      Specified by:
      emitMetric in interface Emitter
      Parameters:
      metric - to emit
      Returns:
      true if exported by at least one exporter, false otherwise
    • flushAggregates

      public void flushAggregates()