use of org.openkilda.wfm.topology.stats.model.SwitchFlowStats in project open-kilda by telstra.
the class KildaEntryCacheService method completeAndForwardFlowStats.
/**
* Process the provided {@link FlowStatsData} by completing it with cached data and forwarding it.
*
* @param data the data to process.
*/
public void completeAndForwardFlowStats(FlowStatsData data) {
SwitchFlowStats stats = new SwitchFlowStats(data.getSwitchId());
for (FlowStatsEntry entry : data.getStats()) {
CookieCacheKey key = new CookieCacheKey(data.getSwitchId(), entry.getCookie());
stats.add(entry, cookieToFlow.get(key));
}
carrier.emitFlowStats(stats);
}
use of org.openkilda.wfm.topology.stats.model.SwitchFlowStats in project open-kilda by telstra.
the class FlowMetricGenBolt method handleInput.
@Override
protected void handleInput(Tuple input) throws Exception {
SwitchFlowStats stats = pullValue(input, STATS_FIELD, SwitchFlowStats.class);
log.debug("dataCache in FlowMetricGenBolt {}", stats);
long timestamp = pullContext(input).getCreateTime();
SwitchId switchId = stats.getSwitchId();
for (FlowStatsAndDescriptor entry : stats.getStatsEntries()) {
handleStatsEntry(entry.getData(), timestamp, switchId, entry.getDescriptor());
}
}
Aggregations