Search in sources :

Example 1 with SidewinderDropwizardReporter

use of com.srotya.sidewinder.core.SidewinderDropwizardReporter in project sidewinder by srotya.

the class MetricsRegistryService method getInstance.

public MetricRegistry getInstance(String key) {
    MetricRegistry reg = registry.get(key);
    if (reg == null) {
        reg = new MetricRegistry();
        if (!DISABLE_SELF_MONITORING) {
            SidewinderDropwizardReporter reporter = new SidewinderDropwizardReporter(reg, key, new MetricFilter() {

                @Override
                public boolean matches(String name, Metric metric) {
                    return true;
                }
            }, TimeUnit.SECONDS, TimeUnit.SECONDS, engine, es);
            reporter.start(1, TimeUnit.SECONDS);
            this.reporter.put(key, reporter);
        }
        registry.put(key, reg);
    }
    return reg;
}
Also used : MetricFilter(com.codahale.metrics.MetricFilter) MetricRegistry(com.codahale.metrics.MetricRegistry) Metric(com.codahale.metrics.Metric) SidewinderDropwizardReporter(com.srotya.sidewinder.core.SidewinderDropwizardReporter)

Aggregations

Metric (com.codahale.metrics.Metric)1 MetricFilter (com.codahale.metrics.MetricFilter)1 MetricRegistry (com.codahale.metrics.MetricRegistry)1 SidewinderDropwizardReporter (com.srotya.sidewinder.core.SidewinderDropwizardReporter)1