use of org.openkilda.wfm.topology.stats.model.MeterCacheKey in project open-kilda by telstra.
the class BaseCacheChangeHandler method handleFlowStatsEntry.
private void handleFlowStatsEntry(SwitchId switchId, FlowSegmentCookie cookie, MeterId meterId, KildaEntryDescriptor entry) {
cacheAction(new CookieCacheKey(switchId, cookie.getValue()), entry);
cacheAction(new CookieCacheKey(switchId, cookie.toBuilder().looped(true).build().getValue()), entry);
cacheAction(new CookieCacheKey(switchId, cookie.toBuilder().mirror(true).build().getValue()), entry);
cacheAction(new CookieCacheKey(switchId, cookie.toBuilder().type(CookieType.SERVER_42_FLOW_RTT_INGRESS).build().getValue()), entry);
if (meterId != null) {
cacheAction(new MeterCacheKey(entry.getSwitchId(), meterId.getValue()), entry);
}
}
use of org.openkilda.wfm.topology.stats.model.MeterCacheKey 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);
}
Aggregations