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


Java MetricWriter.printMetric方法代码示例

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


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

示例1: printMetric

import com.singularity.ee.agent.systemagent.api.MetricWriter; //导入方法依赖的package包/类
/**
 * @param metrics
 */
private void printMetric(Map<String, Number> metrics) {

    for (Map.Entry<String, Number> metric : metrics.entrySet()) {
        MetricWriter metricWriter = super.getMetricWriter(metric.getKey(), MetricWriter.METRIC_AGGREGATION_TYPE_AVERAGE, MetricWriter.METRIC_TIME_ROLLUP_TYPE_AVERAGE, MetricWriter.METRIC_CLUSTER_ROLLUP_TYPE_COLLECTIVE
        );
        Object metricValue = metric.getValue();
        if (metricValue instanceof BigDecimal) {
            metricWriter.printMetric(String.valueOf(((BigDecimal) metricValue).longValue()));
        } else if (metricValue instanceof Double) {
            metricWriter.printMetric(String.valueOf(Math.round((Double) metricValue)));
        } else if (metricValue instanceof Float) {
            metricWriter.printMetric(String.valueOf(Math.round((Float) metricValue)));
        } else {
            metricWriter.printMetric(String.valueOf(metricValue));
        }
    }
}
 
开发者ID:Appdynamics,项目名称:voltdb-monitoring-extension,代码行数:21,代码来源:VoltDBMonitor.java

示例2: printMetric

import com.singularity.ee.agent.systemagent.api.MetricWriter; //导入方法依赖的package包/类
/**
 * Returns the metric to the AppDynamics Controller.
 *
 * @param metricName  Name of the Metric
 * @param metricValue Value of the Metric
 */
public void printMetric(String metricName, Number metricValue) {
    if (metricValue != null) {
        if(metricName.contains(",")) {
            metricName = metricName.replaceAll(",", ":");
        }
        try {
            MetricWriter metricWriter = getMetricWriter(metricName,
                    MetricWriter.METRIC_AGGREGATION_TYPE_AVERAGE,
                    MetricWriter.METRIC_TIME_ROLLUP_TYPE_AVERAGE,
                    MetricWriter.METRIC_CLUSTER_ROLLUP_TYPE_INDIVIDUAL
            );
            metricWriter.printMetric(MetricUtils.toWholeNumberString(metricValue));

        } catch (Exception e) {
            logger.error("Exception while reporting metric " + metricName + " : " + metricValue, e);
        }
    } else {
        logger.warn("Metric " + metricName + " is null");
    }
}
 
开发者ID:Appdynamics,项目名称:mongo-monitoring-extension,代码行数:27,代码来源:MongoDBMonitor.java

示例3: printMetric

import com.singularity.ee.agent.systemagent.api.MetricWriter; //导入方法依赖的package包/类
private void printMetric(String metricPath, Number metricValue, String aggregation, String timeRollup, String cluster) {
    MetricWriter metricWriter = super.getMetricWriter(metricPath, aggregation, timeRollup, cluster);
    if (metricValue != null) {
        if (logger.isDebugEnabled()) {
            logger.debug("Metric [" + metricPath + " = " + metricValue + "]");
        }
        if (metricValue instanceof Double) {
            metricWriter.printMetric(String.valueOf(Math.round((Double) metricValue)));
        } else if (metricValue instanceof Float) {
            metricWriter.printMetric(String.valueOf(Math.round((Float) metricValue)));
        } else {
            metricWriter.printMetric(String.valueOf(metricValue));
        }
    }
}
 
开发者ID:Appdynamics,项目名称:muleesb-monitoring-extension,代码行数:16,代码来源:MuleESBMonitor.java

示例4: printMetric

import com.singularity.ee.agent.systemagent.api.MetricWriter; //导入方法依赖的package包/类
private void printMetric(String metricPath, String metricName, Object metricValue) {
    if (metricValue != null) {
        MetricWriter metricWriter = super.getMetricWriter(getMetricPrefix() + metricPath + metricName,
                MetricWriter.METRIC_AGGREGATION_TYPE_AVERAGE, MetricWriter.METRIC_TIME_ROLLUP_TYPE_AVERAGE,
                MetricWriter.METRIC_CLUSTER_ROLLUP_TYPE_COLLECTIVE);
        metricWriter.printMetric(String.valueOf(metricValue));
    }
}
 
开发者ID:Appdynamics,项目名称:haproxy-monitoring-extension,代码行数:9,代码来源:HAProxyMonitor.java

示例5: printMetric

import com.singularity.ee.agent.systemagent.api.MetricWriter; //导入方法依赖的package包/类
private void printMetric(String metricPrefix, String metricPath, Object metricValue) {
    MetricWriter metricWriter = super.getMetricWriter(metricPrefix + metricPath, MetricWriter.METRIC_AGGREGATION_TYPE_AVERAGE, MetricWriter.METRIC_TIME_ROLLUP_TYPE_AVERAGE, MetricWriter.METRIC_CLUSTER_ROLLUP_TYPE_COLLECTIVE
    );
    if (metricValue instanceof Double) {
        metricWriter.printMetric(String.valueOf(Math.round((Double) metricValue)));
    } else if (metricValue instanceof Float) {
        metricWriter.printMetric(String.valueOf(Math.round((Float) metricValue)));
    } else {
        metricWriter.printMetric(String.valueOf(metricValue));
    }
}
 
开发者ID:Appdynamics,项目名称:azure-monitoring-extension,代码行数:12,代码来源:AzureMonitor.java

示例6: printMetric

import com.singularity.ee.agent.systemagent.api.MetricWriter; //导入方法依赖的package包/类
private void printMetric(String metricPath, String metricValue, String aggregation, String timeRollup, String cluster) {
	MetricWriter metricWriter = super.getMetricWriter(metricPath, aggregation, timeRollup, cluster);
	if (metricValue != null) {
		if (logger.isDebugEnabled()) {
			logger.debug("Metric [" + metricPath + " = " + metricValue + "]");
		}
		metricWriter.printMetric(metricValue);
	}
}
 
开发者ID:Appdynamics,项目名称:tomcat-monitoring-extension,代码行数:10,代码来源:TomcatMonitor.java

示例7: printMetric

import com.singularity.ee.agent.systemagent.api.MetricWriter; //导入方法依赖的package包/类
/**
 * Returns the metric to the AppDynamics Controller.
 *
 * @param metricName  Name of the Metric
 * @param metricValue Value of the Metric
 * @param aggregation Average OR Observation OR Sum
 * @param timeRollup  Average OR Current OR Sum
 * @param cluster     Collective OR Individual
 */
public void printMetric(
        final String metricName,
        final Object metricValue,
        final String aggregation,
        final String timeRollup,
        final String cluster) {
    final MetricWriter metricWriter = getMetricWriter(
            getMetricPrefix() + metricName, aggregation, timeRollup, cluster);
    metricWriter.printMetric(String.valueOf(metricValue));
}
 
开发者ID:Appdynamics,项目名称:nagios-monitoring-extension,代码行数:20,代码来源:NagiosMonitor.java

示例8: printMetric

import com.singularity.ee.agent.systemagent.api.MetricWriter; //导入方法依赖的package包/类
/**
 * Returns the metric to the AppDynamics Controller.
 * @param 	metricName		Name of the Metric
 * @param 	metricValue		Value of the Metric
 * @param 	aggregation		Average OR Observation OR Sum
 * @param 	timeRollup		Average OR Current OR Sum
 * @param 	cluster			Collective OR Individual
 */
private void printMetric(String metricName, Number metricValue, String aggregation, String timeRollup, String cluster) throws Exception
{
    MetricWriter metricWriter = super.getMetricWriter(METRIC_PREFIX + metricName,
            aggregation,
            timeRollup,
            cluster
    );
    metricWriter.printMetric(String.valueOf((long) metricValue.doubleValue()));
}
 
开发者ID:Appdynamics,项目名称:ehcache-monitoring-extension,代码行数:18,代码来源:EhcacheMonitor.java

示例9: printMetric

import com.singularity.ee.agent.systemagent.api.MetricWriter; //导入方法依赖的package包/类
/**
 * Returns the metric to the AppDynamics Controller.
 *
 * @param metricName  Name of the Metric
 * @param metricValue Value of the Metric
 * @param aggregation Average OR Observation OR Sum
 * @param timeRollup  Average OR Current OR Sum
 * @param cluster     Collective OR Individual
 */
private void printMetric(String metricName, Long metricValue, String aggregation, String timeRollup, String cluster) {
    MetricWriter metricWriter = monitor.getMetricWriter(metricName,
            aggregation,
            timeRollup,
            cluster
    );
    metricWriter.printMetric(String.valueOf(metricValue));

    if (logger.isDebugEnabled()) {
        logger.debug(String.format("Sending metric = %s = %s", metricName, metricValue));
    }
}
 
开发者ID:Appdynamics,项目名称:varnish-monitoring-extension,代码行数:22,代码来源:VarnishWrapper.java

示例10: printAllMetrics

import com.singularity.ee.agent.systemagent.api.MetricWriter; //导入方法依赖的package包/类
/**
 * Returns the metric to the AppDynamics Controller.
 * @param 	metricValue		Value of the Metric
 */
private void printAllMetrics()
{
	for(String key : metrics.keySet())
	{
		MetricWriter metricWriter = getMetricWriter(metricPath + key, 
				MetricWriter.METRIC_AGGREGATION_TYPE_OBSERVATION,
				MetricWriter.METRIC_TIME_ROLLUP_TYPE_CURRENT,
				MetricWriter.METRIC_CLUSTER_ROLLUP_TYPE_COLLECTIVE);

		metricWriter.printMetric(String.valueOf(metrics.get(key)));

	}

}
 
开发者ID:Appdynamics,项目名称:pingdom-monitoring-extension,代码行数:19,代码来源:PingdomMonitor.java

示例11: printMetric

import com.singularity.ee.agent.systemagent.api.MetricWriter; //导入方法依赖的package包/类
protected void printMetric(String metricName, String value) {
    if(!Strings.isNullOrEmpty(value)) {
        try {
            MetricWriter metricWriter = getMetricWriter(metricName, MetricWriter.METRIC_AGGREGATION_TYPE_AVERAGE, MetricWriter.METRIC_TIME_ROLLUP_TYPE_AVERAGE,
                    MetricWriter.METRIC_CLUSTER_ROLLUP_TYPE_INDIVIDUAL);
            metricWriter.printMetric(value);
            //System.out.println(metricName + "  " + value);
            if (logger.isDebugEnabled()) {
                logger.debug("METRIC:  NAME:" + metricName + " VALUE:" + value);
            }
        } catch (Exception e) {
            logger.error(e);
        }
    }
}
 
开发者ID:Appdynamics,项目名称:oracle-monitoring-extension,代码行数:16,代码来源:OracleDbMonitor.java


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