/** * Initialize GiraphMetrics with Hadoop Context * * @param conf GiraphConfiguration to use. */ private GiraphMetrics(GiraphConfiguration conf) { perJobOptional = GiraphMetricsRegistry.create(conf, "giraph", "job"); perSuperstep = SuperstepMetricsRegistry.create(conf, INPUT_SUPERSTEP); perJobRequired = GiraphMetricsRegistry.createWithOptional("giraph", "job"); }
/** Stop using metrics (for cleanup) */ public void shutdown() { perJobOptional.shutdown(); perJobRequired.shutdown(); perSuperstep.shutdown(); }
/** Initialize no-op registry that creates no-op metrics. */ private GiraphMetrics() { perJobOptional = GiraphMetricsRegistry.createFake(); perSuperstep = SuperstepMetricsRegistry.createFake(); perJobRequired = GiraphMetricsRegistry.createWithOptional("giraph", "job"); }
/** * Reset the per-superstep MetricsRegistry * * @param superstep long number of superstep */ public void resetSuperstepMetrics(long superstep) { perSuperstep.setSuperstep(superstep); for (ResetSuperstepMetricsObserver observer : observers) { observer.newSuperstep(perSuperstep); } }