当前位置: 首页>>代码示例>>Java>>正文


Java ScheduledReporter.stop方法代码示例

本文整理汇总了Java中com.codahale.metrics.ScheduledReporter.stop方法的典型用法代码示例。如果您正苦于以下问题:Java ScheduledReporter.stop方法的具体用法?Java ScheduledReporter.stop怎么用?Java ScheduledReporter.stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.codahale.metrics.ScheduledReporter的用法示例。


在下文中一共展示了ScheduledReporter.stop方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shutDown

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
@Override
protected void shutDown() throws Exception {
    for (ScheduledReporter entry : reporter.values()) {
        LOG.debug("Stopping metrics reporter: {}", entry);
        entry.stop();
    }
}
 
开发者ID:DevOpsStudio,项目名称:Re-Collector,代码行数:8,代码来源:MetricService.java

示例2: stopMetrics

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
@Override
public void stopMetrics() {
    for (ScheduledReporter r : reporters) {
        r.report();
        LOG.info("Stopping reporter {}", r.toString());
        r.stop();
    }
}
 
开发者ID:apache,项目名称:incubator-omid,代码行数:9,代码来源:CodahaleMetricsProvider.java

示例3: close

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
@Synchronized
@Override
public void close() {
    for (ScheduledReporter r : reporters) {
        try {
            r.report();
            r.stop();
        } catch (Exception e) {
            log.error("Exception report or stop reporter", e);
        }
    }

    metrics.removeMatching(MetricFilter.ALL);
}
 
开发者ID:pravega,项目名称:pravega,代码行数:15,代码来源:StatsProviderImpl.java

示例4: main

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
public static void main(String[] args) {
    InfluxDbReporter influxDbReporter = null;
    ScheduledReporter consoleReporter = null;
    Timer.Context context = null;
    try {
        final MetricRegistry registry = new MetricRegistry();
        consoleReporter = startConsoleReporter(registry);
        influxDbReporter = startInfluxDbReporter(registry, GetHttpSender());

        final Meter myMeter = registry.meter(MetricRegistry.name(SendToLocalInfluxDB.class, "testMetric"));

        final Timer myTimer = registry.timer("testTimer");
        context = myTimer.time();
        for (int i = 0; i < 5000; i++) {
            myMeter.mark();
            myMeter.mark(Math.round(Math.random() * 100.0));
            Thread.sleep(2000);
        }
    } catch (Exception exc) {
        exc.printStackTrace();
        System.exit(1);
    } finally {
        if (context != null) {
            context.stop();
        }
        if (influxDbReporter != null) {
            influxDbReporter.report();
            influxDbReporter.stop();
        }
        if (consoleReporter != null) {
            consoleReporter.report();
            consoleReporter.stop();
        }
        System.out.println("Finished");
    }
}
 
开发者ID:iZettle,项目名称:dropwizard-metrics-influxdb,代码行数:37,代码来源:SendToLocalInfluxDB.java

示例5: shutdown

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
/**
 * Shuts down the handler instance 
 */
public void shutdown() {
	
	for(final JmxReporter jmxReporter : jmxReporters.values()) {
		jmxReporter.stop();
	}
	jmxReporters.clear();
	
	for(final ScheduledReporter scheduledReporter : scheduledReporters.values()) {
		scheduledReporter.stop();
	}
	scheduledReporters.clear();		
}
 
开发者ID:ottogroup,项目名称:SPQR,代码行数:16,代码来源:MetricsHandler.java

示例6: removeScheduledReporter

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
/**
 * {@link ScheduledReporter#stop() Stops} the referenced {@link ScheduledReporter} and removes it from
 * map of managed scheduled reporters
 * @param id
 */
public void removeScheduledReporter(final String id) {
	String key = StringUtils.lowerCase(StringUtils.trim(id));
	ScheduledReporter scheduledReporter = this.scheduledReporters.get(key);
	if(scheduledReporter != null) {
		scheduledReporter.stop();
		this.scheduledReporters.remove(key);
	}		
}
 
开发者ID:ottogroup,项目名称:SPQR,代码行数:14,代码来源:MetricsHandler.java

示例7: stopScheduledReporter

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
/**
 * {@link ScheduledReporter#stop() Stops} the referenced {@link ScheduledReporter} but keeps it referenced
 * @param id
 */
public void stopScheduledReporter(final String id) {
	String key = StringUtils.lowerCase(StringUtils.trim(id));
	ScheduledReporter scheduledReporter = this.scheduledReporters.get(key);
	if(scheduledReporter != null) {
		scheduledReporter.stop();
	}		
}
 
开发者ID:ottogroup,项目名称:SPQR,代码行数:12,代码来源:MetricsHandler.java

示例8: shutdown

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
public void shutdown() {

        cluster.close();
        for (ScheduledReporter reporter : reporters) {
            reporter.report();
            reporter.stop();
        }
    }
 
开发者ID:jshook,项目名称:testclient,代码行数:9,代码来源:ExecutionContext.java

示例9: main

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
public static void main(String[] args) {
	ScheduledReporter r0 = null;
	ScheduledReporter r1 = null;
	try {
		final MetricRegistry registry = new MetricRegistry();
		r0 = startConsoleReporter(registry);
		r1 = startInfluxdbReporter(registry);

		registerGaugeWithValues(registry, "double", Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, 1);
		registerGaugeWithValues(registry, "float", Float.NaN, Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY, 1);

		final Meter mymeter0 = registry.meter("MyMeter.0");
		for (int i = 0; i < 100; i++) {
			mymeter0.mark();
			mymeter0.mark(Math.round(Math.random() * 100.0));
			Thread.sleep(Math.round(Math.random() * 1000.0));
		}
	} catch (Exception exc) {
		exc.printStackTrace();
		System.exit(1);
	} finally {
		if (r1 != null) {
			r1.report();
			r1.stop();
		}
		if (r0 != null) {
			r0.report();
			r0.stop();
		}
		System.out.println("STOP");
	}
}
 
开发者ID:davidB,项目名称:metrics-influxdb,代码行数:33,代码来源:SendToLocalInfluxDB.java

示例10: stop

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
@Override public void stop() {
    for (ScheduledReporter reporter : reporters) {
        reporter.stop();
    }
}
 
开发者ID:epam,项目名称:Lagerta,代码行数:6,代码来源:ReportersManager.java

示例11: stopMetricReporting

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
/**
 * Stop all the {@link com.codahale.metrics.ScheduledReporter}s associated with this {@link MetricContext}.
 */
public void stopMetricReporting() {
  for (ScheduledReporter reporter : this.contextAwareScheduledReporters.values()) {
    reporter.stop();
  }
}
 
开发者ID:Hanmourang,项目名称:Gobblin,代码行数:9,代码来源:MetricContext.java

示例12: main

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
public static void main(String[] args) {
	ScheduledReporter r0 = null;
	ScheduledReporter r1 = null;
	ScheduledReporter r2 = null;
	try {
		final MetricRegistry registry = new MetricRegistry();
		r0 = startConsoleReporter(registry);
		r1 = startInfluxdbReporterHttpV09(registry);
		r2 = startInfluxdbReporterUDPV09(registry);

		// TODO what to do with NaN & infinity
		registerGaugeWithValues(registry, "integer", Integer.MIN_VALUE, Integer.MAX_VALUE, 1);
		registerGaugeWithValues(registry, "long", Long.MIN_VALUE, Long.MAX_VALUE, 1l);
		registerGaugeWithValues(registry, "double", Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, 1.0d);
		registerGaugeWithValues(registry, "float", Float.NaN, Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY, 1.0f);

		final Meter mymeter0 = registry.meter("MyMeter.0");
		for (int i = 0; i < 100; i++) {
			mymeter0.mark();
			mymeter0.mark(Math.round(Math.random() * 100.0));
			Thread.sleep(Math.round(Math.random() * 1000.0));
		}
	} catch (Exception exc) {
		exc.printStackTrace();
		System.exit(1);
	} finally {
		if (r2 != null) {
			r2.report();
			r2.stop();
		}
		if (r1 != null) {
			r1.report();
			r1.stop();
		}
		if (r0 != null) {
			r0.report();
			r0.stop();
		}
		System.out.println("STOP");
	}
}
 
开发者ID:davidB,项目名称:metrics-influxdb,代码行数:42,代码来源:SendToLocalInfluxDB_V09.java


注:本文中的com.codahale.metrics.ScheduledReporter.stop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。