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


Java ScheduledReporter.start方法代码示例

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


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

示例1: startMetricReporting

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
/**
 * Start metric reporting.
 *
 * @param properties configuration properties
 */
public void startMetricReporting(Properties properties) {
  if (this.reportingStarted) {
    LOGGER.warn("Metric reporting has already started");
    return;
  }

  long reportInterval = Long.parseLong(properties.getProperty(ConfigurationKeys.METRICS_REPORT_INTERVAL_KEY,
      ConfigurationKeys.DEFAULT_METRICS_REPORT_INTERVAL));

  buildJmxMetricReporter(properties);
  if (this.jmxReporter.isPresent()) {
    this.jmxReporter.get().start();
  }

  buildFileMetricReporter(properties);
  buildKafkaMetricReporter(properties);
  buildCustomMetricReporters(properties);

  for (ScheduledReporter reporter : this.scheduledReporters) {
    reporter.start(reportInterval, TimeUnit.MILLISECONDS);
  }

  this.reportingStarted = true;
}
 
开发者ID:Hanmourang,项目名称:Gobblin,代码行数:30,代码来源:GobblinMetrics.java

示例2: NbdStatsReporter

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
@Inject
public NbdStatsReporter(MetricRegistry metrics) {
    ScheduledReporter reporter = Slf4jReporter.forRegistry(metrics)
            .withLoggingLevel(Slf4jReporter.LoggingLevel.DEBUG)
            .outputTo(LOGGER)
            .convertRatesTo(TimeUnit.SECONDS)
            .convertDurationsTo(TimeUnit.MILLISECONDS)
            .build();
    reporter.start(5, TimeUnit.SECONDS);
}
 
开发者ID:MineboxOS,项目名称:minebox,代码行数:11,代码来源:NbdStatsReporter.java

示例3: enableIgniteNodeOverloadStop

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
/**
 * Will report to ignite that node is overloaded if the latency for requests from the given quantile will become
 * larger than a given threshold.
 *
 * @param ignite Local ignite instance to be used for overload reporting.
 * @param latencyThreshold Hard threshold after exceeding which node will report overload.
 * @param quantile A quantile in {@code [0..1]}.
 */
public void enableIgniteNodeOverloadStop(Ignite ignite, long latencyThreshold, double quantile) {
    ScheduledReporter reporter = IgniteNodeOverloadReporter.forRegistry(registry)
        .setIgnite(ignite)
        .setLatencyThreshold(latencyThreshold)
        .setQuantile(quantile)
        .build();
    reporter.start(reportFrequency, TimeUnit.MILLISECONDS);
}
 
开发者ID:epam,项目名称:Lagerta,代码行数:17,代码来源:StatisticsCollector.java

示例4: startReporters

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
public void startReporters() {
    for (ReporterProvider provider : reporterProviders) {
        ScheduledReporter reporter = provider.getIfEnabled();

        if (reporter != null) {
            reporters.add(reporter);
            reporter.start(config.getReportFrequency(), TimeUnit.MILLISECONDS);
        }
    }
}
 
开发者ID:epam,项目名称:Lagerta,代码行数:11,代码来源:ReportersManager.java

示例5: startMetrics

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
@Override
public void startMetrics() {
    for (ScheduledReporter r : reporters) {
        LOG.info("Starting metrics reporter {} reporting every {} Secs",
                 r.getClass().getCanonicalName(), metricsOutputFrequencyInSecs);
        r.start(metricsOutputFrequencyInSecs, TimeUnit.SECONDS);
    }
}
 
开发者ID:apache,项目名称:incubator-omid,代码行数:9,代码来源:CodahaleMetricsProvider.java

示例6: startScheduledReporter

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
/**
 * {@link ScheduledReporter#start(long, java.util.concurrent.TimeUnit) Starts} the referenced {@link ScheduledReporter}
 * @param id
 * @param period
 * @param unit
 */
public void startScheduledReporter(final String id, final int period, final TimeUnit unit) {
	String key = StringUtils.lowerCase(StringUtils.trim(id));
	ScheduledReporter scheduledReporter = this.scheduledReporters.get(key);
	if(scheduledReporter != null) {
		scheduledReporter.start(period, unit);
	}		
}
 
开发者ID:ottogroup,项目名称:SPQR,代码行数:14,代码来源:MetricsHandler.java

示例7: createReporter

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
public static ScheduledReporter createReporter(MetricsConfiguration configuration, MetricRegistry metrics) {

        ScheduledReporter reporter = Slf4jReporter.forRegistry(metrics)
                .outputTo(LoggerFactory.getLogger(configuration.getLoggerName()))
                .convertRatesTo(TimeUnit.SECONDS)
                .convertDurationsTo(TimeUnit.MILLISECONDS)
                .build();

        reporter.start(configuration.getReportFrequencyInSeconds(), TimeUnit.SECONDS);

        return reporter;
    }
 
开发者ID:MonsantoCo,项目名称:goldengate-kafka-adapter,代码行数:13,代码来源:MetricsReporterFactory.java

示例8: startInfluxdbReporterUDPV09

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
private static ScheduledReporter startInfluxdbReporterUDPV09(MetricRegistry registry) {
	final ScheduledReporter reporter = InfluxdbReporter.forRegistry(registry)
			.convertRatesTo(TimeUnit.SECONDS)
			.convertDurationsTo(TimeUnit.MILLISECONDS)
			.filter(MetricFilter.ALL)
			.protocol(new UdpInfluxdbProtocol("127.0.0.1", 8089))
			.build();
	reporter.start(20, TimeUnit.SECONDS);
	return reporter;
}
 
开发者ID:davidB,项目名称:metrics-influxdb,代码行数:11,代码来源:SendToLocalInfluxDB_V09.java

示例9: startInfluxdbReporterHttpV09

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
private static ScheduledReporter startInfluxdbReporterHttpV09(MetricRegistry registry) {
	final ScheduledReporter reporter = InfluxdbReporter.forRegistry(registry)
			.convertRatesTo(TimeUnit.SECONDS)
			.convertDurationsTo(TimeUnit.MILLISECONDS)
			.filter(MetricFilter.ALL)
			.protocol(new HttpInfluxdbProtocol("127.0.0.1", 8086, "test", "u0", "u0PWD"))
			.build();
	reporter.start(10, TimeUnit.SECONDS);
	return reporter;
}
 
开发者ID:davidB,项目名称:metrics-influxdb,代码行数:11,代码来源:SendToLocalInfluxDB_V09.java

示例10: enableDebugReporting

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
/**
 * Enables statistics reporting to the console.
 */
public void enableDebugReporting() {
    ScheduledReporter reporter = ConsoleReporter.forRegistry(registry)
        .build();
    reporter.start(reportFrequency, TimeUnit.MILLISECONDS);
}
 
开发者ID:epam,项目名称:Lagerta,代码行数:9,代码来源:StatisticsCollector.java

示例11: enableCsvReporting

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
/**
 * Enables statistics reporting to the csv file.
 *
 * @param csvReportDirectory Directory where .csv files for individual performance meters will be stored.
 */
public void enableCsvReporting(String csvReportDirectory) {
    ScheduledReporter reporter = HumanReadableCsvReporter.forRegistry(registry)
        .build(new File(csvReportDirectory));
    reporter.start(reportFrequency, TimeUnit.MILLISECONDS);
}
 
开发者ID:epam,项目名称:Lagerta,代码行数:11,代码来源:StatisticsCollector.java

示例12: start

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
@Synchronized
@Override
public void start() {
    init();

    if (conf.isEnableCSVReporter()) {
        // NOTE:  metrics output files are exclusive to a given process
        File outdir;
        if (!Strings.isNullOrEmpty(conf.getMetricsPrefix())) {
            outdir = new File(conf.getCsvEndpoint(), conf.getMetricsPrefix());
        } else {
            outdir = new File(conf.getCsvEndpoint());
        }
        outdir.mkdirs();
        log.info("Configuring stats with csv output to directory [{}]", outdir.getAbsolutePath());
        reporters.add(CsvReporter.forRegistry(getMetrics())
                      .convertRatesTo(TimeUnit.SECONDS)
                      .convertDurationsTo(TimeUnit.MILLISECONDS)
                      .build(outdir));
    }
    if (conf.isEnableStatsdReporter()) {
        log.info("Configuring stats with statsD at {}:{}", conf.getStatsDHost(), conf.getStatsDPort());
        reporters.add(StatsDReporter.forRegistry(getMetrics())
                      .build(conf.getStatsDHost(), conf.getStatsDPort()));
    }
    if (conf.isEnableGraphiteReporter()) {
        log.info("Configuring stats with graphite at {}:{}", conf.getGraphiteHost(), conf.getGraphitePort());
        final Graphite graphite = new Graphite(new InetSocketAddress(conf.getGraphiteHost(), conf.getGraphitePort()));
        reporters.add(GraphiteReporter.forRegistry(getMetrics())
            .prefixedWith(conf.getMetricsPrefix())
            .convertRatesTo(TimeUnit.SECONDS)
            .convertDurationsTo(TimeUnit.MILLISECONDS)
            .filter(MetricFilter.ALL)
            .build(graphite));
    }
    if (conf.isEnableJMXReporter()) {
        log.info("Configuring stats with jmx {}", conf.getJmxDomain());
        final JmxReporter jmx = JmxReporter.forRegistry(getMetrics())
            .inDomain(conf.getJmxDomain())
            .convertRatesTo(TimeUnit.SECONDS)
            .convertDurationsTo(TimeUnit.MILLISECONDS)
            .build();
        jmx.start();
    }
    if (conf.isEnableGangliaReporter()) {
        try {
            log.info("Configuring stats with ganglia at {}:{}", conf.getGangliaHost(), conf.getGangliaPort());
            final GMetric ganglia = new GMetric(conf.getGangliaHost(), conf.getGangliaPort(), GMetric.UDPAddressingMode.MULTICAST, 1);
            reporters.add(GangliaReporter.forRegistry(getMetrics())
                .prefixedWith(conf.getMetricsPrefix())
                .convertRatesTo(TimeUnit.SECONDS)
                .convertDurationsTo(TimeUnit.MILLISECONDS)
                .build(ganglia));
        } catch (IOException e) {
            log.warn("ganglia create failure: {}", e);
        }
    }
    if (conf.isEnableConsoleReporter()) {
        log.info("Configuring console reporter");
        reporters.add(ConsoleReporter.forRegistry(getMetrics())
            .convertRatesTo(TimeUnit.SECONDS)
            .convertDurationsTo(TimeUnit.MILLISECONDS)
            .build());
    }
    for (ScheduledReporter r : reporters) {
        r.start(conf.getStatsOutputFrequencySeconds(), TimeUnit.SECONDS);
    }
}
 
开发者ID:pravega,项目名称:pravega,代码行数:69,代码来源:StatsProviderImpl.java

示例13: startMetricReporting

import com.codahale.metrics.ScheduledReporter; //导入方法依赖的package包/类
/**
 * Start all the {@link com.codahale.metrics.ScheduledReporter}s associated with this {@link MetricContext}.
 *
 * @param period the amount of time between polls
 * @param timeUnit the unit for {@code period}
 */
public void startMetricReporting(long period, TimeUnit timeUnit) {
  for (ScheduledReporter reporter : this.contextAwareScheduledReporters.values()) {
    reporter.start(period, timeUnit);
  }
}
 
开发者ID:Hanmourang,项目名称:Gobblin,代码行数:12,代码来源:MetricContext.java


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