use of com.srotya.sidewinder.core.monitoring.MetricsRegistryService in project sidewinder by srotya.
the class DiskMalloc method configure.
@Override
public void configure(Map<String, String> conf, String dataDirectory, String measurementName, StorageEngine engine, ScheduledExecutorService bgTaskPool, ReentrantLock lock) {
this.measurementName = measurementName;
this.lock = lock;
this.dataDirectory = dataDirectory + "/" + measurementName;
this.fileMapIncrement = Integer.parseInt(conf.getOrDefault(CONF_MEASUREMENT_FILE_INCREMENT, String.valueOf(DEFAULT_FILE_INCREMENT)));
this.maxFileSize = Integer.parseInt(conf.getOrDefault(CONF_MEASUREMENT_FILE_MAX, String.valueOf(DEFAULT_MAX_FILE_SIZE)));
this.increment = Integer.parseInt(conf.getOrDefault(CONF_MEASUREMENT_INCREMENT_SIZE, String.valueOf(DEFAULT_INCREMENT_SIZE)));
if (maxFileSize < 0) {
throw new IllegalArgumentException("File size can't be negative or greater than:" + Integer.MAX_VALUE);
}
if (fileMapIncrement >= maxFileSize) {
throw new IllegalArgumentException("File increment can't be greater than or equal to file size");
}
this.ptrFile = new File(getPtrPath());
this.ptrFileIncrement = Integer.parseInt(conf.getOrDefault(CONF_MALLOC_PTRFILE_INCREMENT, String.valueOf(PTR_INCREMENT)));
if (engine != null) {
enableMetricsCapture = true;
MetricsRegistryService reg = MetricsRegistryService.getInstance(engine, bgTaskPool);
MetricRegistry r = reg.getInstance("memoryops");
metricsBufferSize = r.counter("buffer-size");
metricsBufferResize = r.counter("buffer-resize");
metricsFileRotation = r.counter("file-rotation");
metricsBufferCounter = r.counter("buffer-counter");
}
if (debug) {
oldBufferReferences = new ConcurrentHashMap<>();
}
}
use of com.srotya.sidewinder.core.monitoring.MetricsRegistryService in project sidewinder by srotya.
the class PersistentMeasurement method enableMetricsMonitoring.
private void enableMetricsMonitoring(StorageEngine engine, ScheduledExecutorService bgTaskPool) {
if (engine == null || bgTaskPool == null) {
enableMetricsCapture = false;
logger.warning("Metrics capture is disabled");
return;
}
logger.info("Metrics capture is enabled");
MetricsRegistryService reg = MetricsRegistryService.getInstance(engine, bgTaskPool);
MetricRegistry metaops = reg.getInstance("metaops");
metricsTimeSeriesCounter = metaops.counter("timeseries-counter");
enableMetricsCapture = true;
}
use of com.srotya.sidewinder.core.monitoring.MetricsRegistryService in project sidewinder by srotya.
the class MemStorageEngine method enableMetricsService.
public void enableMetricsService() {
MetricsRegistryService reg = MetricsRegistryService.getInstance(this, bgTaskPool);
MetricRegistry metaops = reg.getInstance("metaops");
metricsDbCounter = metaops.counter("dbcreate");
metricsMeasurementCounter = metaops.counter("measurementcreate");
metricsWriteCounter = reg.getInstance("ops").counter("writecounter");
}
use of com.srotya.sidewinder.core.monitoring.MetricsRegistryService in project sidewinder by srotya.
the class DiskStorageEngine method enableMetricsService.
public void enableMetricsService() {
MetricsRegistryService reg = MetricsRegistryService.getInstance(this, bgTaskPool);
MetricRegistry metaops = reg.getInstance("metaops");
metricsDbCounter = metaops.counter("db-create");
metricsMeasurementCounter = metaops.counter("measurement-create");
metricsWriteCounter = reg.getInstance("ops").counter("write-counter");
}
Aggregations