Search in sources :

Example 1 with MetricsRegistryService

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<>();
    }
}
Also used : MetricRegistry(com.codahale.metrics.MetricRegistry) RandomAccessFile(java.io.RandomAccessFile) File(java.io.File) MetricsRegistryService(com.srotya.sidewinder.core.monitoring.MetricsRegistryService)

Example 2 with MetricsRegistryService

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;
}
Also used : MetricRegistry(com.codahale.metrics.MetricRegistry) MetricsRegistryService(com.srotya.sidewinder.core.monitoring.MetricsRegistryService)

Example 3 with MetricsRegistryService

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");
}
Also used : MetricRegistry(com.codahale.metrics.MetricRegistry) MetricsRegistryService(com.srotya.sidewinder.core.monitoring.MetricsRegistryService)

Example 4 with MetricsRegistryService

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");
}
Also used : MetricRegistry(com.codahale.metrics.MetricRegistry) MetricsRegistryService(com.srotya.sidewinder.core.monitoring.MetricsRegistryService)

Aggregations

MetricRegistry (com.codahale.metrics.MetricRegistry)4 MetricsRegistryService (com.srotya.sidewinder.core.monitoring.MetricsRegistryService)4 File (java.io.File)1 RandomAccessFile (java.io.RandomAccessFile)1