本文整理汇总了Java中info.ganglia.gmetric4j.gmetric.GMetric.UDPAddressingMode类的典型用法代码示例。如果您正苦于以下问题:Java UDPAddressingMode类的具体用法?Java UDPAddressingMode怎么用?Java UDPAddressingMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UDPAddressingMode类属于info.ganglia.gmetric4j.gmetric.GMetric包,在下文中一共展示了UDPAddressingMode类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: start
import info.ganglia.gmetric4j.gmetric.GMetric.UDPAddressingMode; //导入依赖的package包/类
@Override
public void start(Settings settings, MetricRegistry metricRegistry) {
if (settings.getBoolean("metrics.ganglia.enabled", false)) {
final String hostname = settings.getLocalHostname();
final String address = settings.getRequiredString("metrics.ganglia.address");
final int port = settings.getInteger("metrics.ganglia.port", 8649);
final long period = settings.getDuration("metrics.ganglia.period", TimeUnit.SECONDS, 60);
try {
GMetric ganglia = new GMetric(address, port, UDPAddressingMode.MULTICAST, 1);
reporter = GangliaReporter.forRegistry(metricRegistry).convertRatesTo(TimeUnit.SECONDS)
.convertDurationsTo(TimeUnit.MILLISECONDS).build(ganglia);
reporter.start(period, TimeUnit.SECONDS);
log.info("Started Ganglia Metrics reporter for '{}', updating every {} seconds", hostname, period);
} catch (IOException e) {
log.error("Failed to start Ganglia reporter!", e);
}
} else {
log.debug("Ganglia Metrics reporter is disabled");
}
}
开发者ID:gitblit,项目名称:fathom,代码行数:26,代码来源:Reporter.java
示例2: start
import info.ganglia.gmetric4j.gmetric.GMetric.UDPAddressingMode; //导入依赖的package包/类
@Override
public void start(PippoSettings settings, MetricRegistry metricRegistry) {
if (settings.getBoolean("metrics.ganglia.enabled", false)) {
final String hostname = settings.getLocalHostname();
final String address = settings.getRequiredString("metrics.ganglia.address");
final int port = settings.getInteger("metrics.ganglia.port", 8649);
final long period = settings.getDurationInSeconds("metrics.ganglia.period", 60);
try {
GMetric ganglia = new GMetric(address, port, UDPAddressingMode.MULTICAST, 1);
reporter = GangliaReporter.forRegistry(metricRegistry).convertRatesTo(TimeUnit.SECONDS)
.convertDurationsTo(TimeUnit.MILLISECONDS).build(ganglia);
reporter.start(period, TimeUnit.SECONDS);
log.info("Started Ganglia Metrics reporter for '{}', updating every {} seconds", hostname, period);
} catch (IOException e) {
log.error("Failed to start Ganglia reporter!", e);
}
} else {
log.debug("Ganglia Metrics reporter is disabled");
}
}
开发者ID:decebals,项目名称:pippo,代码行数:26,代码来源:Reporter.java
示例3: configureMetricsGangliaReporter
import info.ganglia.gmetric4j.gmetric.GMetric.UDPAddressingMode; //导入依赖的package包/类
private void configureMetricsGangliaReporter() {
if (configuration.has(GANGLIA_HOST_OR_GROUP)) {
final String host = configuration.get(GANGLIA_HOST_OR_GROUP);
final Duration ival = configuration.get(GANGLIA_INTERVAL);
final Integer port = configuration.get(GANGLIA_PORT);
final UDPAddressingMode addrMode;
final String addrModeStr = configuration.get(GANGLIA_ADDRESSING_MODE);
if (addrModeStr.equalsIgnoreCase("multicast")) {
addrMode = UDPAddressingMode.MULTICAST;
} else if (addrModeStr.equalsIgnoreCase("unicast")) {
addrMode = UDPAddressingMode.UNICAST;
} else throw new AssertionError();
final Boolean proto31 = configuration.get(GANGLIA_USE_PROTOCOL_31);
final int ttl = configuration.get(GANGLIA_TTL);
final UUID uuid = configuration.has(GANGLIA_UUID)? UUID.fromString(configuration.get(GANGLIA_UUID)):null;
String spoof = null;
if (configuration.has(GANGLIA_SPOOF)) spoof = configuration.get(GANGLIA_SPOOF);
try {
MetricManager.INSTANCE.addGangliaReporter(host, port, addrMode, ttl, proto31, uuid, spoof, ival);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:31,代码来源:GraphDatabaseConfiguration.java
示例4: initGangliaPublish
import info.ganglia.gmetric4j.gmetric.GMetric.UDPAddressingMode; //导入依赖的package包/类
/**
* Initialize publishing by Ganglia.
* <p>
* Only the summary registry is published.
*
* @param repo the component repository, not null
* @param summaryRegistry the summary metrics registry, not null
* @param detailedRegistry the detailed metrics registry, not null
*/
protected void initGangliaPublish(ComponentRepository repo, MetricRegistry summaryRegistry, MetricRegistry detailedRegistry) throws IOException {
ArgumentChecker.notNull(getGangliaAddress(), "gangliaAddress");
ArgumentChecker.notNull(getGangliaPort(), "gangliaPort");
ArgumentChecker.notNull(getGangliaAddressingMode(), "gangliaAddressingMode");
ArgumentChecker.notNull(getGangliaTtl(), "gangliaTtl");
GMetric ganglia = new GMetric(getGangliaAddress(), getGangliaPort(), UDPAddressingMode.valueOf(getGangliaAddressingMode()), getGangliaTtl(), true);
GangliaReporter gangliaReporter = GangliaReporter.forRegistry(summaryRegistry)
.convertRatesTo(TimeUnit.SECONDS)
.convertDurationsTo(TimeUnit.MILLISECONDS)
.build(ganglia);
repo.registerLifecycle(new GangliaReporterLifecycle(gangliaReporter));
}
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:22,代码来源:MetricsRepositoryComponentFactory.java
注:本文中的info.ganglia.gmetric4j.gmetric.GMetric.UDPAddressingMode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论