Java Code Examples for com.yammer.metrics.core.MetricName#toString()

The following examples show how to use com.yammer.metrics.core.MetricName#toString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MemoryReporter.java    From incubator-retired-blur with Apache License 2.0 5 votes vote down vote up
private org.apache.blur.thrift.generated.Metric getMetric(MetricName name,
    ConcurrentMap<String, org.apache.blur.thrift.generated.Metric> context) {
  String nameStr = name.toString();
  org.apache.blur.thrift.generated.Metric metric = context.get(nameStr);
  if (metric == null) {
    metric = new org.apache.blur.thrift.generated.Metric();
    context.put(nameStr, metric);
    metric.setName(nameStr);
  }
  return metric;
}
 
Example 2
Source File: JSONReporter.java    From incubator-retired-blur with Apache License 2.0 5 votes vote down vote up
private String getName(MetricName metricName) {
  // String group = metricName.getGroup();
  // String name = metricName.getName();
  // String scope = metricName.getScope();
  // String type = metricName.getType();
  // JSONObject jsonObject = new JSONObject();
  // jsonObject.put("name", name);
  // jsonObject.put("group", group);
  // jsonObject.put("scope", scope);
  // jsonObject.put("type", type);
  return metricName.toString();
}