use of org.openkilda.wfm.topology.stats.model.SwitchMeterStats in project open-kilda by telstra.
the class KildaEntryCacheService method completeAndForwardMeterStats.
/**
* Process the provided {@link MeterStatsData} by completing it with cached data and forwarding it.
*
* @param data the data to process.
*/
public void completeAndForwardMeterStats(MeterStatsData data) {
SwitchMeterStats stats = new SwitchMeterStats(data.getSwitchId());
for (MeterStatsEntry entry : data.getStats()) {
MeterCacheKey key = new MeterCacheKey(data.getSwitchId(), entry.getMeterId());
stats.add(entry, switchAndMeterToFlow.get(key));
}
carrier.emitMeterStats(stats);
}
use of org.openkilda.wfm.topology.stats.model.SwitchMeterStats in project open-kilda by telstra.
the class MeterStatsMetricGenBolt method handleInput.
@Override
protected void handleInput(Tuple input) throws Exception {
SwitchMeterStats stats = pullValue(input, STATS_FIELD, SwitchMeterStats.class);
log.debug("Received meter statistics: {}.", stats);
long timestamp = getCommandContext().getCreateTime();
SwitchId switchId = stats.getSwitchId();
for (MeterStatsAndDescriptor entry : stats.getStatsEntries()) {
handleStatsData(entry.getData(), timestamp, switchId, entry.getDescriptor());
}
}
Aggregations