Search in sources :

Example 71 with Endpoint

use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.

the class IslLatencyBolt method handleInput.

@Override
protected void handleInput(Tuple input) throws PipelineException {
    InfoData data = pullValue(input, LATENCY_DATA_FIELD, InfoData.class);
    long timestamp = getCommandContext().getCreateTime();
    if (data instanceof IslRoundTripLatency) {
        Endpoint destination = pullValue(input, CACHE_DATA_FIELD, Endpoint.class);
        islLatencyService.handleRoundTripIslLatency((IslRoundTripLatency) data, destination, timestamp);
    } else if (data instanceof IslOneWayLatency) {
        islLatencyService.handleOneWayIslLatency((IslOneWayLatency) data, timestamp);
    } else {
        unhandledInput(input);
    }
}
Also used : Endpoint(org.openkilda.wfm.share.model.Endpoint) IslRoundTripLatency(org.openkilda.messaging.info.event.IslRoundTripLatency) InfoData(org.openkilda.messaging.info.InfoData) IslOneWayLatency(org.openkilda.messaging.info.event.IslOneWayLatency)

Example 72 with Endpoint

use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.

the class IslStatsBolt method handleLatencyData.

private void handleLatencyData(Tuple input) throws PipelineException {
    InfoData data = pullValue(input, LATENCY_DATA_FIELD, InfoData.class);
    long timestamp = getCommandContext().getCreateTime();
    if (data instanceof IslRoundTripLatency) {
        Endpoint destination = pullValue(input, CACHE_DATA_FIELD, Endpoint.class);
        islStatsService.handleRoundTripLatencyMetric(timestamp, (IslRoundTripLatency) data, destination);
    } else if (data instanceof IslOneWayLatency) {
        islStatsService.handleOneWayLatencyMetric(timestamp, (IslOneWayLatency) data);
    } else {
        unhandledInput(input);
    }
}
Also used : Endpoint(org.openkilda.wfm.share.model.Endpoint) IslRoundTripLatency(org.openkilda.messaging.info.event.IslRoundTripLatency) InfoData(org.openkilda.messaging.info.InfoData) IslOneWayLatency(org.openkilda.messaging.info.event.IslOneWayLatency)

Aggregations

Endpoint (org.openkilda.wfm.share.model.Endpoint)72 Test (org.junit.Test)33 Isl (org.openkilda.model.Isl)17 IslInfoData (org.openkilda.messaging.info.event.IslInfoData)13 SwitchId (org.openkilda.model.SwitchId)10 Switch (org.openkilda.model.Switch)8 IslReference (org.openkilda.wfm.share.model.IslReference)8 PathNode (org.openkilda.messaging.info.event.PathNode)7 Instant (java.time.Instant)6 IslDataHolder (org.openkilda.wfm.topology.network.model.IslDataHolder)6 HashSet (java.util.HashSet)4 Set (java.util.Set)4 DiscoverIslCommandData (org.openkilda.messaging.command.discovery.DiscoverIslCommandData)4 IslNotFoundException (org.openkilda.wfm.error.IslNotFoundException)4 Values (org.apache.storm.tuple.Values)3 IslRoundTripLatency (org.openkilda.messaging.info.event.IslRoundTripLatency)3 InMemoryGraphBasedTest (org.openkilda.persistence.inmemory.InMemoryGraphBasedTest)3 CommandContext (org.openkilda.wfm.CommandContext)3 VisibleForTesting (com.google.common.annotations.VisibleForTesting)2 HashMap (java.util.HashMap)2