Hi,
I do not know any way to measure the latency of what you are exactly asking about. However, I am not an ONOS dev so there might be some stats related to it that are already part of the controller.
Actually what you are asking about is, probably, the latency of the control channel (channel between the switch and the controller). In reality, the way to properly measure this is to get the switch and controller to timestamp packets, both being synchronized to the lowest possible unit of time and margin of error (let's an error of a few microseconds or a millisecond in the worst case). I don't know any switches that timestamp packets for the only purpose of measuring the latency.
First of all, I am no expert in the exact field of the question you ask about. I imagine, though, you could have several approaches to measure the latency.
1) If I had to guess, I'd say that you might be able to create an app that tracks Openflow packets (maybe ebpf?). If you can identify a packet (say its hash, or some kind of secret) then you can probably measure the RTT, as close to the interface as possible. In this way you remove any possible userspace delay.
2) The "easiest" approach would be to track ONOS control messages to a switch (let's say a FLOW_MOD or statistics request), then measure the timestamp when it is sent and then check again when it is received (RTT). It will not be nowhere near as precise as any other method. But if you are measuring tens of milliseconds (or worse), it might work. This latency would also account for the message processing time taken by the switch until it replies back. So this is not the exact "wire" delay of the message.
As said, if there is already something in the controller that offers this information, I cannot tell you anything about it.
Hopefully, other engineers and researchers might have a better answer for you.
Cheers,