Search in sources :

Example 1 with IslRttStatsData

use of org.openkilda.messaging.info.stats.IslRttStatsData in project open-kilda by telstra.

the class RouterBolt method handleInput.

@Override
protected void handleInput(Tuple input) throws PipelineException {
    Message message = pullValue(input, FIELD_ID_PAYLOAD, Message.class);
    if (active) {
        if (message instanceof InfoMessage) {
            log.debug("Received info message {}", message);
            InfoData data = ((InfoMessage) message).getData();
            if (data instanceof IslOneWayLatency) {
                handleOneWayLatency(input, (IslOneWayLatency) data);
            } else if (data instanceof IslRoundTripLatency) {
                handleRoundTripLatency(input, (IslRoundTripLatency) data);
            } else if (data instanceof IslRttStatsData) {
                handleRoundTripLatency(input, (IslRttStatsData) data);
            } else {
                unhandledInput(input);
            }
        } else {
            unhandledInput(input);
        }
    }
}
Also used : InfoMessage(org.openkilda.messaging.info.InfoMessage) Message(org.openkilda.messaging.Message) IslRoundTripLatency(org.openkilda.messaging.info.event.IslRoundTripLatency) InfoMessage(org.openkilda.messaging.info.InfoMessage) InfoData(org.openkilda.messaging.info.InfoData) IslRttStatsData(org.openkilda.messaging.info.stats.IslRttStatsData) IslOneWayLatency(org.openkilda.messaging.info.event.IslOneWayLatency)

Example 2 with IslRttStatsData

use of org.openkilda.messaging.info.stats.IslRttStatsData in project open-kilda by telstra.

the class StatsCollector method sendStats.

void sendStats(LatencyPacketBucket latencyPacketBucket) throws InvalidProtocolBufferException {
    long currentTimeMillis = System.currentTimeMillis();
    for (FlowLatencyPacket packet : latencyPacketBucket.getFlowLatencyPacketList()) {
        FlowRttStatsData data = new FlowRttStatsData(packet.getFlowId(), FlowDirection.fromBoolean(packet.getDirection()).name().toLowerCase(), packet.getT0(), packet.getT1());
        InfoMessage message = new InfoMessage(data, currentTimeMillis, format("stats42-%s-%d", sessionId, packet.getPacketId()));
        log.debug("InfoMessage {}", message);
        template.send(flowStatToStormTopic, packet.getFlowId(), message);
    }
    for (IslLatencyPacket packet : latencyPacketBucket.getIslLatencyPacketList()) {
        IslRttStatsData data = new IslRttStatsData(packet.getSwitchId(), packet.getPort(), packet.getT0(), packet.getT1(), "server42");
        String key = format("%s-%d", packet.getSwitchId(), packet.getPort());
        InfoMessage message = new InfoMessage(data, currentTimeMillis, format("stats42-%s-isl-%s", sessionId, key));
        log.debug("InfoMessage {}", message);
        template.send(islStatToStormTopic, key, message);
    }
}
Also used : FlowRttStatsData(org.openkilda.messaging.info.stats.FlowRttStatsData) IslLatencyPacket(org.openkilda.server42.stats.messaging.Statistics.IslLatencyPacket) InfoMessage(org.openkilda.messaging.info.InfoMessage) FlowLatencyPacket(org.openkilda.server42.stats.messaging.Statistics.FlowLatencyPacket) IslRttStatsData(org.openkilda.messaging.info.stats.IslRttStatsData)

Aggregations

InfoMessage (org.openkilda.messaging.info.InfoMessage)2 IslRttStatsData (org.openkilda.messaging.info.stats.IslRttStatsData)2 Message (org.openkilda.messaging.Message)1 InfoData (org.openkilda.messaging.info.InfoData)1 IslOneWayLatency (org.openkilda.messaging.info.event.IslOneWayLatency)1 IslRoundTripLatency (org.openkilda.messaging.info.event.IslRoundTripLatency)1 FlowRttStatsData (org.openkilda.messaging.info.stats.FlowRttStatsData)1 FlowLatencyPacket (org.openkilda.server42.stats.messaging.Statistics.FlowLatencyPacket)1 IslLatencyPacket (org.openkilda.server42.stats.messaging.Statistics.IslLatencyPacket)1