use of org.openkilda.messaging.model.PingReport in project open-kilda by telstra.
the class FlowPingReportTest method serializeLoop.
@Test
public void serializeLoop() throws Exception {
PingReport report = new PingReport("flowId-" + getClass().getSimpleName(), State.OPERATIONAL);
FlowPingReport origin = new FlowPingReport(report);
InfoMessage wrapper = new InfoMessage(origin, System.currentTimeMillis(), getClass().getSimpleName());
serializer.serialize(wrapper);
InfoMessage decodedWrapper = (InfoMessage) serializer.deserialize();
InfoData decoded = decodedWrapper.getData();
Assert.assertEquals(String.format("%s object have been mangled in serialisation/deserialization loop", origin.getClass().getName()), origin, decoded);
}
use of org.openkilda.messaging.model.PingReport in project open-kilda by telstra.
the class FailReporter method report.
private void report(Tuple input, String flowId, FlowObserver flowObserver, State state) throws PipelineException {
String logMessage = String.format("{FLOW-PING} Flow %s become %s", flowId, state);
if (state != State.OPERATIONAL) {
String cookies = flowObserver.getFlowTreadsInState(state).stream().map(cookie -> String.format("0x%016x", cookie)).collect(Collectors.joining(", "));
if (!cookies.isEmpty()) {
logMessage += String.format("(%s)", cookies);
}
}
log.info(logMessage);
Values output = new Values(new PingReport(flowId, state), pullContext(input));
getOutput().emit(input, output);
}
Aggregations