Interface MetricCollector

All Known Implementing Classes:
DefaultMetricCollector, NoOpMetricCollector

@NotThreadSafe public interface MetricCollector
Used to collect metrics reported by the SDK.
  • Method Details

    • name

      String name()
      Returns:
      The name of this collector.
    • reportMetric

      <T> void reportMetric(SdkMetric<T> metric, T data)
      Report a metric.
    • createChild

      MetricCollector createChild(String name)
      Create a child of this metric collector.
      Parameters:
      name - The name of the child collector.
      Returns:
      The child collector.
    • collect

      MetricCollection collect()
      Return the collected metrics.

      Calling collect() prevents further invocations of reportMetric(SdkMetric, Object).

      Returns:
      The collected metrics.
    • create

      static MetricCollector create(String name)