Refine search
MetricsConnection(final ConnectionImplementation conn) { this.scope = conn.toString(); this.registry = new MetricRegistry(); this.registry.register(getExecutorPoolName(), new RatioGauge() { @Override this.registry.register(getMetaPoolName(), new RatioGauge() { @Override "numActionsPerServer", scope)); this.reporter = JmxReporter.forRegistry(this.registry).build(); this.reporter.start();
/** * Stop a {@link JmxReporter} previously created by a call to * {@link #addJmxReporter(String, String)} and release it for GC. Idempotent * between calls to the associated add method. Does nothing before the first * call to the associated add method. */ public synchronized void removeJmxReporter() { if (null != jmxReporter) jmxReporter.stop(); jmxReporter = null; }
@Override public void close() { jmxReporter.close(); }
private void reportToJMX(MetricRegistry metricRegistry) { final JmxReporter reporter = JmxReporter.forRegistry(metricRegistry).build(); reporter.start(); reporters.add(reporter); }
@Inject public MetricsFactoryImpl(MetricsFig metricsFig) { registry = new MetricRegistry(); String metricsHost = metricsFig.getHost(); if (!metricsHost.equals("false")) { Graphite graphite = new Graphite(new InetSocketAddress(metricsHost, 2003)); graphiteReporter = GraphiteReporter.forRegistry(registry).prefixedWith("usergrid-metrics") .convertRatesTo(TimeUnit.SECONDS) .convertDurationsTo(TimeUnit.MILLISECONDS).filter(MetricFilter.ALL) .build(graphite); graphiteReporter.start(30, TimeUnit.SECONDS); } else { logger.warn("MetricsService:Logger not started."); } jmxReporter = JmxReporter.forRegistry(registry).build(); jmxReporter.start(); }
@Inject public NdBenchDefaultMonitor(IConfiguration config) { this.config = config; this.metrics = new MetricRegistry(); readHistogram = metrics.histogram(name("NdBenchDefaultMonitor", "readlatency")); writeHistogram = metrics.histogram(name("NdBenchDefaultMonitor", "writelatency")); readSuccess = metrics.counter(name("NdBenchDefaultMonitor", "readSuccess")); readFailure = metrics.counter(name("NdBenchDefaultMonitor", "readFailure")); writeSuccess = metrics.counter(name("NdBenchDefaultMonitor", "writeSuccess")); writeFailure = metrics.counter(name("NdBenchDefaultMonitor", "writeFailure")); cacheHits = metrics.meter(name("NdBenchDefaultMonitor", "cacheHits")); cacheMiss = metrics.meter(name("NdBenchDefaultMonitor", "cacheMiss")); readRPS = metrics.meter(name("NdBenchDefaultMonitor", "readRPS")); writeRPS = metrics.meter(name("NdBenchDefaultMonitor", "writeRPS")); //Starting JMXReporter final JmxReporter reporter = JmxReporter.forRegistry(metrics).inDomain("netflix.ndbench.metrics").build(); reporter.start(); }
public void init() throws IOException { // Use offHeap store. store = new MVStore.Builder().fileStore(new OffHeapStore()).open(); Dictionary<String, Object> properties = configAdmin.getConfiguration(OFFHEAP_CONFIG).getProperties(); if (properties != null && properties.get(OFFHEAP_SIZE) != null) { if (properties.get(OFFHEAP_SIZE) instanceof String) { maxSizeInBytes = convertByteSizes((String)properties.get(OFFHEAP_SIZE)); } } reporter = JmxReporter.forRegistry(offheapMetrics).inDomain(this.getClass().getPackage().getName()).build(); offheapMetrics.register(MetricRegistry.name("offHeapSize"), new Gauge<Long>() { @Override public Long getValue() { return getSize(); } }); reporter.start(); LOG.info("initializing H2 OffHeapStore with max size : {} ", maxSizeInBytes); }
config.metricRegistry.register(metricName("jvm", "memory_usage"), new MemoryUsageGaugeSet()); config.metricRegistry.register(metricName("jvm", "gc"), new GarbageCollectorMetricSet()); config.metricRegistry.register(metricName("jvm", "class_loading"), new ClassLoadingGaugeSet()); config.metricRegistry.register(metricName("jvm", "file_descriptor_ratio"), new FileDescriptorRatioGauge()); config.metricRegistry.register(metricName("jvm", "thread_states"), new CachedThreadStatesGaugeSet(60, TimeUnit.SECONDS)); final JmxReporter jmxReporter = JmxReporter.forRegistry(config.metricRegistry) .convertRatesTo(TimeUnit.SECONDS) .convertDurationsTo(TimeUnit.MILLISECONDS) .build(); jmxReporter.start(); LOGGER.info("JMX metrics reporter enabled");
private Metrics(Configuration conf) { registry = new MetricRegistry(); registry.registerAll(new GarbageCollectorMetricSet()); registry.registerAll(new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer())); registry.registerAll(new MemoryUsageGaugeSet()); registry.registerAll(new ThreadStatesGaugeSet()); scheduledReporters.add(reporter); } else if (reporterName.equals("jmx") || reporterName.endsWith("jmxmetricsreporter")) { JmxReporter reporter = JmxReporter.forRegistry(registry) .convertRatesTo(TimeUnit.SECONDS) .convertDurationsTo(TimeUnit.MILLISECONDS) .build(); reporter.start(); reporters.add(reporter); } else if (reporterName.startsWith("json") || reporterName.endsWith("jsonfilemetricsreporter")) {
public class HttpServerModule extends ServletModule { @Override protected void configureServlets() { MetricRegistry metricRegistry = new MetricRegistry(); bind(MetricRegistry.class).toInstance(metricRegistry); install(new SandwichModule()); install(new JerseyMetricsModule()); JmxReporter reporter = JmxReporter.forRegistry(metricRegistry).build(); reporter.start(); } }
public AbstractStreamsApp(StreamsAppConfig config) { notNull(config, "config can't be null"); this.config = config; this.jmxReporter = JmxReporter.forRegistry(new MetricRegistry()).build(); }
@Override public void start() { mReporter.start(); }
/** * Creates a new {@link JmxSink} with a {@link Properties} and {@link MetricRegistry}. * * @param properties the properties * @param registry the metric registry to register */ public JmxSink(Properties properties, MetricRegistry registry) { mReporter = JmxReporter.forRegistry(registry).build(); }
/** * {@inheritDoc} */ @Override public void stop() throws Exception { if (filter != null) { PluginServletFilter.removeFilter(filter); } metricRegistry.removeMatching(MetricFilter.ALL); for (String name : healthCheckRegistry.getNames()) { healthCheckRegistry.unregister(name); } if (jmxReporter!=null) { jmxReporter.stop(); jmxReporter = null; } }
@Inject public NdBenchDefaultMonitor(IConfiguration config) { this.config = config; this.metrics = new MetricRegistry(); readHistogram = metrics.histogram(name("NdBenchDefaultMonitor", "readlatency")); writeHistogram = metrics.histogram(name("NdBenchDefaultMonitor", "writelatency")); readSuccess = metrics.counter(name("NdBenchDefaultMonitor", "readSuccess")); readFailure = metrics.counter(name("NdBenchDefaultMonitor", "readFailure")); writeSuccess = metrics.counter(name("NdBenchDefaultMonitor", "writeSuccess")); writeFailure = metrics.counter(name("NdBenchDefaultMonitor", "writeFailure")); cacheHits = metrics.meter(name("NdBenchDefaultMonitor", "cacheHits")); cacheMiss = metrics.meter(name("NdBenchDefaultMonitor", "cacheMiss")); readRPS = metrics.meter(name("NdBenchDefaultMonitor", "readRPS")); writeRPS = metrics.meter(name("NdBenchDefaultMonitor", "writeRPS")); //Starting JMXReporter final JmxReporter reporter = JmxReporter.forRegistry(metrics).inDomain("netflix.ndbench.metrics").build(); reporter.start(); }
MetricRegistry dropwizardMetricsRegistry = new MetricRegistry(); JmxReporter jmxReporter = JmxReporter.forRegistry(dropwizardMetricsRegistry).inDomain(METRIC_DOMAIN).build(); jmxReporter.start();
public void start() { setMetricsReporter(metricsGroupName); final String jvmMetricsName = metricsGroupName + "-JVM"; setMetricsReporter(jvmMetricsName); if(!inited) { metricRegistry.register(MetricRegistry.name(jvmMetricsName, "MEMORY"), new MemoryUsageGaugeSet()); metricRegistry.register(MetricRegistry.name(jvmMetricsName, "FILE"), new FileDescriptorRatioGauge()); metricRegistry.register(MetricRegistry.name(jvmMetricsName, "GC"), new GarbageCollectorMetricSet()); metricRegistry.register(MetricRegistry.name(jvmMetricsName, "THREAD"), new ThreadStatesGaugeSet()); metricRegistry.register(MetricRegistry.name(jvmMetricsName, "LOG"), new LogEventGaugeSet()); jmxReporter = JmxReporter.forRegistry(metricRegistry).inDomain("Tajo") .createsObjectNamesWith(new TajoJMXObjectNameFactory()).build(); jmxReporter.start(); } inited = true; }
Metrics(Cluster.Manager manager) { this.manager = manager; this.executorQueueDepth = registry.register("executor-queue-depth", buildQueueSizeGauge(manager.executorQueue)); this.blockingExecutorQueueDepth = registry.register( "blocking-executor-queue-depth", buildQueueSizeGauge(manager.blockingExecutorQueue)); this.reconnectionSchedulerQueueSize = registry.register( "reconnection-scheduler-task-count", buildQueueSizeGauge(manager.reconnectionExecutorQueue)); this.taskSchedulerQueueSize = registry.register( "task-scheduler-task-count", buildQueueSizeGauge(manager.scheduledTasksExecutorQueue)); if (manager.configuration.getMetricsOptions().isJMXReportingEnabled()) { this.jmxReporter = JmxReporter.forRegistry(registry).inDomain(manager.clusterName + "-metrics").build(); this.jmxReporter.start(); } else { this.jmxReporter = null; } }