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
A
Tagger
implementation that saves metrics records to be accessible from pollRecord()
and pollRecord(long, TimeUnit)
, until rolloverRecords()
is
called.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.opencensus.stats.MeasureMap
pollRecord
(long timeout, TimeUnit unit) void
Disconnect this tagger with the contexts it has created so far.
-
Field Details
-
records
-
-
Constructor Details
-
FakeStatsRecorder
public FakeStatsRecorder()
-
-
Method Details
-
newMeasureMap
public io.opencensus.stats.MeasureMap newMeasureMap()- Specified by:
newMeasureMap
in classio.opencensus.stats.StatsRecorder
-
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 inpollRecord()
. Useful for isolating the records between test cases. -
getCurrentRecordSink
-