Search in sources :

Example 1 with MultiCountStatAndMetric

use of org.apache.storm.metric.internal.MultiCountStatAndMetric in project storm by apache.

the class CommonStats method valueStats.

protected Map valueStats(String[] fields) {
    Map ret = new HashMap();
    for (String field : fields) {
        IMetric metric = this.get(field);
        if (metric instanceof MultiCountStatAndMetric) {
            StatsUtil.putKV(ret, field, ((MultiCountStatAndMetric) metric).getTimeCounts());
        } else if (metric instanceof MultiLatencyStatAndMetric) {
            StatsUtil.putKV(ret, field, ((MultiLatencyStatAndMetric) metric).getTimeLatAvg());
        }
    }
    StatsUtil.putKV(ret, CommonStats.RATE, this.getRate());
    return ret;
}
Also used : HashMap(java.util.HashMap) MultiLatencyStatAndMetric(org.apache.storm.metric.internal.MultiLatencyStatAndMetric) IMetric(org.apache.storm.metric.api.IMetric) Map(java.util.Map) HashMap(java.util.HashMap) MultiCountStatAndMetric(org.apache.storm.metric.internal.MultiCountStatAndMetric)

Aggregations

HashMap (java.util.HashMap)1 Map (java.util.Map)1 IMetric (org.apache.storm.metric.api.IMetric)1 MultiCountStatAndMetric (org.apache.storm.metric.internal.MultiCountStatAndMetric)1 MultiLatencyStatAndMetric (org.apache.storm.metric.internal.MultiLatencyStatAndMetric)1