List of usage examples for org.apache.hadoop.metrics2 MetricsRecord timestamp
long timestamp();
From source file:io.warp10.sensision.hadoop.SensisionSink.java
License:Apache License
@Override public void putMetrics(MetricsRecord record) { Map<String, String> labels = new HashMap<String, String>(); for (MetricsTag tag : record.tags()) { if (null != tag.value()) { labels.put(tag.name(), tag.value()); }//from w w w .j av a2s . co m } StringBuilder sb = new StringBuilder(); for (AbstractMetric metric : record.metrics()) { sb.setLength(0); sb.append(this.prefix); sb.append(metric.name()); String cls = sb.toString(); Sensision.set(cls, labels, record.timestamp() * Sensision.TIME_UNITS_PER_MS, null, null, null, metric.value(), ttl); } }