Class StatsTestUtils.FakeStatsRecorder

java.lang.Object
io.opencensus.stats.StatsRecorder
io.grpc.internal.testing.StatsTestUtils.FakeStatsRecorder
Enclosing class:
StatsTestUtils

public static final class StatsTestUtils.FakeStatsRecorder extends io.opencensus.stats.StatsRecorder
A Tagger implementation that saves metrics records to be accessible from pollRecord() and pollRecord(long, TimeUnit), until rolloverRecords() is called.
  • Constructor Details

    • FakeStatsRecorder

      public FakeStatsRecorder()
  • Method Details

    • newMeasureMap

      public io.opencensus.stats.MeasureMap newMeasureMap()
      Specified by:
      newMeasureMap in class io.opencensus.stats.StatsRecorder
    • pollRecord

      public StatsTestUtils.MetricsRecord pollRecord()
    • pollRecord

      public StatsTestUtils.MetricsRecord pollRecord(long timeout, TimeUnit unit) throws InterruptedException
      Throws:
      InterruptedException
    • rolloverRecords

      public void rolloverRecords()
      Disconnect this tagger with the contexts it has created so far. The records from those contexts will not show up in pollRecord(). Useful for isolating the records between test cases.