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


Java MetricWriteHelper.printMetric方法代码示例

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


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

示例1: printMetric

import com.appdynamics.extensions.util.MetricWriteHelper; //导入方法依赖的package包/类
/**
 * Returns the metric to the AppDynamics Controller.
 *
 * @param metricPrefix Metric prefix
 * @param metricName   Name of the Metric
 * @param metricValue  Value of the Metric
 */
private void printMetric(String metricPrefix, String metricName, Object metricValue) {

    String aggregation = MetricWriter.METRIC_AGGREGATION_TYPE_OBSERVATION;
    String timeRollup = MetricWriter.METRIC_TIME_ROLLUP_TYPE_AVERAGE;
    String cluster = MetricWriter.METRIC_CLUSTER_ROLLUP_TYPE_COLLECTIVE;
    String serverName = (String) server.get("name");
    String metricPath = metricPrefix + METRIC_SEPARATOR + serverName + METRIC_SEPARATOR + metricName;
    MetricWriteHelper metricWriter = configuration.getMetricWriter();
    metricWriter.printMetric(metricPath, metricValue.toString(), aggregation, timeRollup, cluster);

    if (logger.isDebugEnabled()) {
        logger.debug("Metric [" + aggregation + "/" + timeRollup + "/" + cluster
                + "] metric = " + metricPath + " = " + metricValue);
    }
}
 
开发者ID:Appdynamics,项目名称:nginx-monitoring-extension,代码行数:23,代码来源:NGinXMonitorTask.java

示例2: printMetrics

import com.appdynamics.extensions.util.MetricWriteHelper; //导入方法依赖的package包/类
private void printMetrics(Map<String, BigDecimal> solrMetrics) {
    MetricWriteHelper metricWriter = configuration.getMetricWriter();
    String metricPrefix = configuration.getMetricPrefix();
    String aggregation = MetricWriter.METRIC_AGGREGATION_TYPE_AVERAGE;
    String cluster = MetricWriter.METRIC_CLUSTER_ROLLUP_TYPE_INDIVIDUAL;
    String timeRollup = MetricWriter.METRIC_TIME_ROLLUP_TYPE_AVERAGE;

    for (Map.Entry<String, BigDecimal> entry : solrMetrics.entrySet()) {
        String metricPath = metricPrefix + "|" + server.get("name").toString() + entry.getKey();
        String metricValue = String.valueOf(entry.getValue());
        metricWriter.printMetric(metricPath, metricValue, aggregation, timeRollup, cluster);
    }
}
 
开发者ID:Appdynamics,项目名称:solr-monitoring-extension,代码行数:14,代码来源:SolrMonitorTask.java


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