use of org.openkilda.wfm.topology.stats.model.CookieCacheKey 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.CookieCacheKey in project open-kilda by telstra.
the class BaseCacheChangeHandler method handleStatsEntry.
@Override
public void handleStatsEntry(YFlowSubDescriptor descriptor) {
FlowSegmentCookie cookie = descriptor.getCookie();
handleFlowStatsEntry(descriptor.getSwitchId(), cookie, descriptor.getMeterId(), descriptor);
FlowSegmentCookie satelliteCookie = cookie.toBuilder().yFlow(true).build();
cacheAction(new CookieCacheKey(descriptor.getSwitchId(), satelliteCookie.getValue()), descriptor);
}
use of org.openkilda.wfm.topology.stats.model.CookieCacheKey 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);
}
}
Aggregations