Search in sources :

Example 1 with SwitchFlowStats

use of org.openkilda.wfm.topology.stats.model.SwitchFlowStats 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 SwitchFlowStats

use of org.openkilda.wfm.topology.stats.model.SwitchFlowStats in project open-kilda by telstra.

the class FlowMetricGenBolt method handleInput.

@Override
protected void handleInput(Tuple input) throws Exception {
    SwitchFlowStats stats = pullValue(input, STATS_FIELD, SwitchFlowStats.class);
    log.debug("dataCache in FlowMetricGenBolt {}", stats);
    long timestamp = pullContext(input).getCreateTime();
    SwitchId switchId = stats.getSwitchId();
    for (FlowStatsAndDescriptor entry : stats.getStatsEntries()) {
        handleStatsEntry(entry.getData(), timestamp, switchId, entry.getDescriptor());
    }
}
Also used : FlowStatsAndDescriptor(org.openkilda.wfm.topology.stats.model.FlowStatsAndDescriptor) SwitchId(org.openkilda.model.SwitchId) SwitchFlowStats(org.openkilda.wfm.topology.stats.model.SwitchFlowStats)

Aggregations

SwitchFlowStats (org.openkilda.wfm.topology.stats.model.SwitchFlowStats)2 FlowStatsEntry (org.openkilda.messaging.info.stats.FlowStatsEntry)1 SwitchId (org.openkilda.model.SwitchId)1 CookieCacheKey (org.openkilda.wfm.topology.stats.model.CookieCacheKey)1 FlowStatsAndDescriptor (org.openkilda.wfm.topology.stats.model.FlowStatsAndDescriptor)1