Search in sources :

Example 1 with MeterCacheKey

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

Example 2 with MeterCacheKey

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

Aggregations

MeterCacheKey (org.openkilda.wfm.topology.stats.model.MeterCacheKey)2 MeterStatsEntry (org.openkilda.messaging.info.stats.MeterStatsEntry)1 CookieCacheKey (org.openkilda.wfm.topology.stats.model.CookieCacheKey)1 SwitchMeterStats (org.openkilda.wfm.topology.stats.model.SwitchMeterStats)1