Class PerfStatsPublisher

java.lang.Object
org.robolectric.util.PerfStatsPublisher

public class PerfStatsPublisher extends Object
Helper class used by the test runner to manage PerfStatsReporters and publish data
  • Method Details

    • getInstance

      public static PerfStatsPublisher getInstance()
    • addReporters

      public void addReporters(List<PerfStatsReporter> reporters)
    • doFinalReportOnShutdown

      public void doFinalReportOnShutdown()
      Register a JVM shutdown hook that calls PerfStatsReporter#finalReport on all reporters
    • doFinalReportOnShutdown

      public void doFinalReportOnShutdown(Runnable preFinalReportTask)
      A variant of doFinalReportOnShutdown() that allows running a task before finalReport is called
    • report

      public void report(PerfStatsCollector collector)
      Report the currently stored metrics to the registered PerfStatsReporter.

      Normally this is called by test runner at end of each test.