new File(morphlineFile), morphlineId, morphlineContext, finalChild, override); this.mappingTimer = morphlineContext.getMetricRegistry().timer( MetricRegistry.name("morphline.app", Metrics.ELAPSED_TIME)); this.numRecords = morphlineContext.getMetricRegistry().meter( MetricRegistry.name("morphline.app", Metrics.NUM_RECORDS)); this.numFailedRecords = morphlineContext.getMetricRegistry().meter( MetricRegistry.name("morphline.app", "numFailedRecords")); this.numExceptionRecords = morphlineContext.getMetricRegistry().meter( MetricRegistry.name("morphline.app", "numExceptionRecords"));
@Override protected MetricRegistry getMetricRegistry() { return context.getMetricRegistry(); } @Override
@Override protected MetricRegistry getMetricRegistry() { return context.getMetricRegistry(); } @Override
/** Returns a timer for maintaining main-memory metrics. */ protected Timer getTimer(String... names) { return getContext().getMetricRegistry().timer(getMetricName(names)); }
/** Returns a timer for maintaining main-memory metrics. */ protected Timer getTimer(String... names) { return getContext().getMetricRegistry().timer(getMetricName(names)); }
/** Returns a meter for maintaining main-memory metrics. */ protected Meter getMeter(String... names) { return getContext().getMetricRegistry().meter(getMetricName(names)); }
/** Returns a counter for maintaining main-memory metrics. */ protected Counter getCounter(String... names) { return getContext().getMetricRegistry().counter(getMetricName(names)); }
/** Returns a meter for maintaining main-memory metrics. */ protected Meter getMeter(String... names) { return getContext().getMetricRegistry().meter(getMetricName(names)); }
/** Returns a counter for maintaining main-memory metrics. */ protected Counter getCounter(String... names) { return getContext().getMetricRegistry().counter(getMetricName(names)); }
@Override protected void doNotify(Record notification) { for (Object event : Notifications.getLifecycleEvents(notification)) { if (event == Notifications.LifecycleEvent.SHUTDOWN) { synchronized (REGISTRIES) { Map<File, CsvReporter> reporters = REGISTRIES.get(getContext().getMetricRegistry()); if (reporters != null) { CsvReporter reporter = reporters.remove(outputDir); if (reporter != null) { reporter.stop(); } } } } } super.doNotify(notification); }
@Override protected void doNotify(Record notification) { for (Object event : Notifications.getLifecycleEvents(notification)) { if (event == Notifications.LifecycleEvent.SHUTDOWN) { synchronized (REGISTRIES) { Map<String, Slf4jReporter> reporters = REGISTRIES.get(getContext().getMetricRegistry()); if (reporters != null) { Slf4jReporter reporter = reporters.remove(logger); if (reporter != null) { reporter.stop(); } } } } } super.doNotify(notification); }
/** Returns a histogram for maintaining main-memory metrics. */ protected Histogram getHistogram(String... names) { return getContext().getMetricRegistry().histogram(getMetricName(names)); }
@Override protected void doNotify(Record notification) { for (Object event : Notifications.getLifecycleEvents(notification)) { if (event == Notifications.LifecycleEvent.SHUTDOWN) { synchronized (REGISTRIES) { Map<String, JmxReporter> reporters = REGISTRIES.get(getContext().getMetricRegistry()); if (reporters != null) { JmxReporter reporter = reporters.remove(domain); if (reporter != null) { reporter.stop(); } } } } } super.doNotify(notification); }
@Override protected void doNotify(Record notification) { for (Object event : Notifications.getLifecycleEvents(notification)) { if (event == Notifications.LifecycleEvent.SHUTDOWN) { synchronized (REGISTRIES) { Map<String, JmxReporter> reporters = REGISTRIES.get(getContext().getMetricRegistry()); if (reporters != null) { JmxReporter reporter = reporters.remove(domain); if (reporter != null) { reporter.stop(); } } } } } super.doNotify(notification); }
/** Returns a histogram for maintaining main-memory metrics. */ protected Histogram getHistogram(String... names) { return getContext().getMetricRegistry().histogram(getMetricName(names)); }
@Override public void cleanup(Emitter<T> emitter) { try { collector.setEmitter(emitter); Notifications.notifyCommitTransaction(morphline); Notifications.notifyShutdown(morphline); } finally { addMetricsToMRCounters(morphlineContext.getMetricRegistry()); } }
@Override protected void cleanup(Context context) throws IOException, InterruptedException { heartBeater.close(); runner.cleanup(); addMetricsToMRCounters(runner.getMorphlineContext().getMetricRegistry(), context); super.cleanup(context); }
@Override protected void cleanup(Context context) throws IOException, InterruptedException { heartBeater.close(); runner.cleanup(); addMetricsToMRCounters(runner.getMorphlineContext().getMetricRegistry(), context); super.cleanup(context); }
public RegisterJVMMetrics(CommandBuilder builder, Config config, Command parent, Command child, final MorphlineContext context) { super(builder, config, parent, child, context); validateArguments(); MetricRegistry registry = context.getMetricRegistry(); BufferPoolMetricSet bufferPoolMetrics = new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer()); registerAll("jvm.buffers", bufferPoolMetrics, registry); registerAll("jvm.gc", new GarbageCollectorMetricSet(), registry); registerAll("jvm.memory", new MemoryUsageGaugeSet(), registry); registerAll("jvm.threads", new ThreadStatesGaugeSet(), registry); register("jvm.fileDescriptorCountRatio", new FileDescriptorRatioGauge(), registry); context.getHealthCheckRegistry().register("deadlocks", new ThreadDeadlockHealthCheck()); }
public RegisterJVMMetrics(CommandBuilder builder, Config config, Command parent, Command child, final MorphlineContext context) { super(builder, config, parent, child, context); validateArguments(); MetricRegistry registry = context.getMetricRegistry(); BufferPoolMetricSet bufferPoolMetrics = new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer()); registerAll("jvm.buffers", bufferPoolMetrics, registry); registerAll("jvm.gc", new GarbageCollectorMetricSet(), registry); registerAll("jvm.memory", new MemoryUsageGaugeSet(), registry); registerAll("jvm.threads", new ThreadStatesGaugeSet(), registry); register("jvm.fileDescriptorCountRatio", new FileDescriptorRatioGauge(), registry); context.getHealthCheckRegistry().register("deadlocks", new ThreadDeadlockHealthCheck()); }