Search in sources :

Example 1 with SpecificAggregateStats

use of org.apache.storm.generated.SpecificAggregateStats in project storm by apache.

the class StatsUtil method thriftifySpoutAggStats.

private static ComponentAggregateStats thriftifySpoutAggStats(Map m) {
    ComponentAggregateStats stats = new ComponentAggregateStats();
    stats.set_type(ComponentType.SPOUT);
    stats.set_last_error((ErrorInfo) getByKey(m, LAST_ERROR));
    thriftifyCommonAggStats(stats, m);
    SpoutAggregateStats spoutAggStats = new SpoutAggregateStats();
    spoutAggStats.set_complete_latency_ms(getByKeyOr0(m, COMP_LATENCY).doubleValue());
    SpecificAggregateStats specificStats = SpecificAggregateStats.spout(spoutAggStats);
    stats.set_specific_stats(specificStats);
    return stats;
}
Also used : SpecificAggregateStats(org.apache.storm.generated.SpecificAggregateStats) ComponentAggregateStats(org.apache.storm.generated.ComponentAggregateStats) SpoutAggregateStats(org.apache.storm.generated.SpoutAggregateStats)

Example 2 with SpecificAggregateStats

use of org.apache.storm.generated.SpecificAggregateStats in project storm by apache.

the class StatsUtil method thriftifyBoltAggStats.

private static ComponentAggregateStats thriftifyBoltAggStats(Map m) {
    ComponentAggregateStats stats = new ComponentAggregateStats();
    stats.set_type(ComponentType.BOLT);
    stats.set_last_error((ErrorInfo) getByKey(m, LAST_ERROR));
    thriftifyCommonAggStats(stats, m);
    BoltAggregateStats boltAggStats = new BoltAggregateStats();
    boltAggStats.set_execute_latency_ms(getByKeyOr0(m, EXEC_LATENCY).doubleValue());
    boltAggStats.set_process_latency_ms(getByKeyOr0(m, PROC_LATENCY).doubleValue());
    boltAggStats.set_executed(getByKeyOr0(m, EXECUTED).longValue());
    boltAggStats.set_capacity(getByKeyOr0(m, CAPACITY).doubleValue());
    SpecificAggregateStats specificStats = SpecificAggregateStats.bolt(boltAggStats);
    stats.set_specific_stats(specificStats);
    return stats;
}
Also used : SpecificAggregateStats(org.apache.storm.generated.SpecificAggregateStats) ComponentAggregateStats(org.apache.storm.generated.ComponentAggregateStats) BoltAggregateStats(org.apache.storm.generated.BoltAggregateStats)

Aggregations

ComponentAggregateStats (org.apache.storm.generated.ComponentAggregateStats)2 SpecificAggregateStats (org.apache.storm.generated.SpecificAggregateStats)2 BoltAggregateStats (org.apache.storm.generated.BoltAggregateStats)1 SpoutAggregateStats (org.apache.storm.generated.SpoutAggregateStats)1