本文整理汇总了Java中com.newrelic.metrics.publish.processors.EpochCounter类的典型用法代码示例。如果您正苦于以下问题:Java EpochCounter类的具体用法?Java EpochCounter怎么用?Java EpochCounter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EpochCounter类属于com.newrelic.metrics.publish.processors包,在下文中一共展示了EpochCounter类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: NginxAgent
import com.newrelic.metrics.publish.processors.EpochCounter; //导入依赖的package包/类
public NginxAgent(String name, String statusUrl) throws ConfigurationException {
super(GUID, VERSION);
try {
this.name = name;
this.url = new URL(statusUrl);
this.connectionsAccepted = new EpochCounter();
this.connectionsDropped = new EpochCounter();
this.requestsTotal = new EpochCounter();
} catch (MalformedURLException e) {
throw new ConfigurationException("Status URL could not be parsed", e);
}
}
开发者ID:rchouinard,项目名称:newrelic-nginx-plugin,代码行数:13,代码来源:NginxAgent.java
示例2: getProcessorForNode
import com.newrelic.metrics.publish.processors.EpochCounter; //导入依赖的package包/类
public Processor getProcessorForNode(String id, String nodeName)
{
String key = getProcessorKey(id, nodeName);
if (!processors.containsKey(key)) {
processors.put(key, new EpochCounter());
}
return processors.get(key);
}
开发者ID:s12v,项目名称:newrelic-elasticsearch,代码行数:10,代码来源:EpochCounterFactory.java
示例3: getProcessor
import com.newrelic.metrics.publish.processors.EpochCounter; //导入依赖的package包/类
public Processor getProcessor(String key)
{
if (!processors.containsKey(key)) {
processors.put(key, new EpochCounter());
}
return processors.get(key);
}
开发者ID:s12v,项目名称:newrelic-elasticsearch,代码行数:9,代码来源:EpochCounterFactory.java
示例4: WikipediaAgent
import com.newrelic.metrics.publish.processors.EpochCounter; //导入依赖的package包/类
/**
* Constructor for Wikipedia Agent.
* Uses name for Component Human Label and host for building Wikipedia's Metric service.
* @param name
* @param host
* @throws ConfigurationException if URL for Wikipedia's metric service could not be built correctly from provided host
*/
public WikipediaAgent(String name, String host) throws ConfigurationException {
super(GUID, VERSION);
try {
this.name = name;
this.url = new URL(HTTP, host, WIKIPEDIA_URL);
this.articleCreationRate = new EpochCounter();
} catch (MalformedURLException e) {
throw new ConfigurationException("Wikipedia metric URL could not be parsed", e);
}
}
开发者ID:newrelic-platform,项目名称:newrelic_java_wikipedia_plugin,代码行数:18,代码来源:WikipediaAgent.java
示例5: MemcachedAgent
import com.newrelic.metrics.publish.processors.EpochCounter; //导入依赖的package包/类
public MemcachedAgent(String name, String host, Integer port) {
super(GUID, VERSION);
this.name = name;
this.host = host;
this.port = port;
// Initialize Counters
this.userCpuUsageCounter = new EpochCounter();
this.systemCpuUsageCounter = new EpochCounter();
this.totalConnectionsCounter = new EpochCounter();
this.cmdGetCounter = new EpochCounter();
this.cmdSetCounter = new EpochCounter();
this.cmdFlushCounter = new EpochCounter();
this.getHitsCounter = new EpochCounter();
this.getMissesCounter = new EpochCounter();
this.deleteHitsCounter = new EpochCounter();
this.deleteMissesCounter = new EpochCounter();
this.incrHitsCounter = new EpochCounter();
this.incrMissesCounter = new EpochCounter();
this.decrHitsCounter = new EpochCounter();
this.decrMissesCounter = new EpochCounter();
this.casHitsCounter = new EpochCounter();
this.casMissesCounter = new EpochCounter();
this.casBadValCounter = new EpochCounter();
this.bytesReadCounter = new EpochCounter();
this.bytesWrittenCounter = new EpochCounter();
this.totalItemsCounter = new EpochCounter();
this.evictionsCounter = new EpochCounter();
this.reclaimsCounter = new EpochCounter();
logger.debug("Memcached Agent initialized: " + formatAgentParams(name, host, port));
}
开发者ID:newrelic-platform,项目名称:newrelic_memcached_java_plugin,代码行数:34,代码来源:MemcachedAgent.java
示例6: reportCacheUseMetrics
import com.newrelic.metrics.publish.processors.EpochCounter; //导入依赖的package包/类
private void reportCacheUseMetrics(String name, Float hits, Float misses, EpochCounter hitCounter, EpochCounter missCounter) {
Float processedHits = (Float)hitCounter.process(hits);
Float processedMisses = (Float)missCounter.process(misses);
reportMetric(String.format("CacheUse/%s/Actions/Hits", name), "commands/seconds", processedHits);
reportMetric(String.format("CacheUse/%s/Actions/Misses", name), "commands/seconds", processedMisses);
if(processedHits != null && processedMisses != null) {
Float percentMisses = (processedHits > 0 || processedMisses > 0) ? (processedMisses / (processedHits + processedMisses)) * 100 : 0;
reportMetric(String.format("CacheUse/Summary/%s/Missed", name), "percent", percentMisses);
}
}
开发者ID:newrelic-platform,项目名称:newrelic_memcached_java_plugin,代码行数:13,代码来源:MemcachedAgent.java
示例7: MetricMeta
import com.newrelic.metrics.publish.processors.EpochCounter; //导入依赖的package包/类
public MetricMeta(boolean isCounter, String unit) {
this.unit = unit;
if (isCounter) {
this.counter = new EpochCounter();
}
}
开发者ID:newrelic-platform,项目名称:newrelic_mysql_java_plugin,代码行数:7,代码来源:MetricMeta.java
示例8: getCounter
import com.newrelic.metrics.publish.processors.EpochCounter; //导入依赖的package包/类
public EpochCounter getCounter() {
return this.counter;
}
开发者ID:newrelic-platform,项目名称:newrelic_mysql_java_plugin,代码行数:4,代码来源:MetricMeta.java
示例9: getMetric
import com.newrelic.metrics.publish.processors.EpochCounter; //导入依赖的package包/类
private Metric getMetric(Element n) throws ParseException {
String type = n.getElementsByTagName("type").item(0) != null ? n.getElementsByTagName("type").item(0).getTextContent() : null;
String ident = n.getElementsByTagName("ident").item(0) != null ? n.getElementsByTagName("ident").item(0).getTextContent() : null;
String name = n.getElementsByTagName("name").item(0) != null ? n.getElementsByTagName("name").item(0).getTextContent() : null;
String description = n.getElementsByTagName("description").item(0) != null ? n.getElementsByTagName("description").item(0).getTextContent()
: null;
String value = n.getElementsByTagName("value").item(0) != null ? n.getElementsByTagName("value").item(0).getTextContent() : null;
String flag = n.getElementsByTagName("flag").item(0) != null ? n.getElementsByTagName("flag").item(0).getTextContent() : null;
StringBuilder key = new StringBuilder();
key.append("Varnish/");
// does it have a custom group?
String group = getGroup(name);
if (group != null) {
key.append(group + "/");
} else if (type != null)
key.append(type + "/");
else {
key.append("main/");
int pos = name.indexOf("_");
if (pos != -1) {
key.append(name.substring(0, pos) + "/");
}
}
if (ident != null)
key.append(ident + "/");
key.append(description);
String actualKey = key.toString();
if ("a".equals(flag)) {
if (!epochCounters.containsKey(actualKey)) {
epochCounters.put(actualKey, new EpochCounter());
}
return new Metric(actualKey, getUnitName(name) + "/sec", epochCounters.get(actualKey).process(NumberFormat.getInstance().parse(value)));
} else {
return new Metric(actualKey, getUnitName(name), NumberFormat.getInstance().parse(value));
}
}
开发者ID:threelegs,项目名称:newrelic-plugins,代码行数:44,代码来源:Varnish.java
注:本文中的com.newrelic.metrics.publish.processors.EpochCounter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论