Package org.robolectric.util
Class PerfStatsCollector
java.lang.Object
org.robolectric.util.PerfStatsCollector
Collects performance statistics for later reporting via 
PerfStatsReporter.- Since:
- 3.6
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionclassEvent for perf stats collection.static interfaceRunnable that throws an exception.static interfacePerfStatsCollector.ThrowingSupplier<T,F extends Exception> Supplier that throws an exception.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic PerfStatsCollectorvoidincrementCount(String eventName) <E extends Exception>
 voidmeasure(String eventName, PerfStatsCollector.ThrowingRunnable<E> runnable) <T,E extends Exception> 
 Tmeasure(String eventName, PerfStatsCollector.ThrowingSupplier<T, E> supplier) <T> voidputMetadata(Class<T> metadataClass, T metadata) voidreset()voidsetEnabled(boolean isEnabled) If not enabled, don't bother retaining perf stats, saving some memory and CPU cycles.startEvent(String eventName) 
- 
Constructor Details- 
PerfStatsCollectorpublic PerfStatsCollector()
 
- 
- 
Method Details- 
getInstance
- 
setEnabledpublic void setEnabled(boolean isEnabled) If not enabled, don't bother retaining perf stats, saving some memory and CPU cycles.
- 
startEvent
- 
measurepublic <T,E extends Exception> T measure(String eventName, PerfStatsCollector.ThrowingSupplier<T, E> supplier) throws E- Throws:
- E extends Exception
 
- 
incrementCount
- 
measurepublic <E extends Exception> void measure(String eventName, PerfStatsCollector.ThrowingRunnable<E> runnable) throws E - Throws:
- E extends Exception
 
- 
getMetrics
- 
putMetadata
- 
getMetadata
- 
resetpublic void reset()
 
-