Package io.grpc.internal.testing
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
ATagger
implementation that saves metrics records to be accessible frompollRecord()
andpollRecord(long, TimeUnit)
, untilrolloverRecords()
is called.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.BlockingQueue<StatsTestUtils.MetricsRecord>
records
-
Constructor Summary
Constructors Constructor Description FakeStatsRecorder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.concurrent.BlockingQueue<StatsTestUtils.MetricsRecord>
getCurrentRecordSink()
io.opencensus.stats.MeasureMap
newMeasureMap()
StatsTestUtils.MetricsRecord
pollRecord()
StatsTestUtils.MetricsRecord
pollRecord(long timeout, java.util.concurrent.TimeUnit unit)
void
rolloverRecords()
Disconnect this tagger with the contexts it has created so far.
-
-
-
Field Detail
-
records
private java.util.concurrent.BlockingQueue<StatsTestUtils.MetricsRecord> records
-
-
Method Detail
-
newMeasureMap
public io.opencensus.stats.MeasureMap newMeasureMap()
- Specified by:
newMeasureMap
in classio.opencensus.stats.StatsRecorder
-
pollRecord
public StatsTestUtils.MetricsRecord pollRecord()
-
pollRecord
public StatsTestUtils.MetricsRecord pollRecord(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
- Throws:
java.lang.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 inpollRecord()
. Useful for isolating the records between test cases.
-
getCurrentRecordSink
private java.util.concurrent.BlockingQueue<StatsTestUtils.MetricsRecord> getCurrentRecordSink()
-
-