Search in sources :

Example 1 with CookieCacheKey

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);
}
Also used : FlowStatsEntry(org.openkilda.messaging.info.stats.FlowStatsEntry) CookieCacheKey(org.openkilda.wfm.topology.stats.model.CookieCacheKey) SwitchFlowStats(org.openkilda.wfm.topology.stats.model.SwitchFlowStats)

Example 2 with CookieCacheKey

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);
}
Also used : FlowSegmentCookie(org.openkilda.model.cookie.FlowSegmentCookie) CookieCacheKey(org.openkilda.wfm.topology.stats.model.CookieCacheKey)

Example 3 with CookieCacheKey

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);
    }
}
Also used : MeterCacheKey(org.openkilda.wfm.topology.stats.model.MeterCacheKey) CookieCacheKey(org.openkilda.wfm.topology.stats.model.CookieCacheKey)

Aggregations

CookieCacheKey (org.openkilda.wfm.topology.stats.model.CookieCacheKey)3 FlowStatsEntry (org.openkilda.messaging.info.stats.FlowStatsEntry)1 FlowSegmentCookie (org.openkilda.model.cookie.FlowSegmentCookie)1 MeterCacheKey (org.openkilda.wfm.topology.stats.model.MeterCacheKey)1 SwitchFlowStats (org.openkilda.wfm.topology.stats.model.SwitchFlowStats)1