import net.pterodactylus.util.thread.NamedThreadFactory;
import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Stopwatch;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
private volatile long lastConfigurationUpdate;
private final MetricRegistry metricRegistry;
+ private final Histogram configurationSaveTimeHistogram;
/**
* Creates a new core.
this.database = database;
this.metricRegistry = metricRegistry;
preferences = new Preferences(eventBus);
+ this.configurationSaveTimeHistogram = metricRegistry.histogram("configuration.save.duration", () -> new Histogram(new ExponentiallyDecayingReservoir(3000, 0)));
}
//
database.save();
/* now save it. */
+ Stopwatch stopwatch = Stopwatch.createStarted();
configuration.save();
+ configurationSaveTimeHistogram.update(stopwatch.elapsed(TimeUnit.MICROSECONDS));
} catch (ConfigurationException ce1) {
logger.log(Level.SEVERE, "Could not store configuration!", ce1);