class Scriptroute::ProbeResponse

A ProbeResponse is a pair of a probe and its response. Scriptroute is designed around the idea that a general purpose engine can recognize the response to any probe, and be in charge of doing so, so that measurement tools need not have the rights to look at every packet.

This design does limit somewhat, since probes that are capable of soliciting more than one response (e.g., via fragmentation) will not be managed properly.

Attributes

probe[RW]

@return [TimedPacket]

response[RW]

@return [TimedPacket]

Public Instance Methods

rtt() click to toggle source

@return [Float,nil] Provides the apparent round trip time of this probe-response pair, or nil if either time is missing.

# File lib/scriptroute.rb, line 138
def rtt
  if response and probe and probe.time then
    response.time - probe.time
  else
    nil
  end
end
to_s() click to toggle source

this method implemented in pure ruby regardless of interpreter state. @return [String]

# File lib/scriptroute/packets.rb, line 1001
def to_s
  if @probe then
    if(@probe.time)  then
      "%s @%5.6f -> %s +%5.6f" % [@probe.packet, @probe.time, (@response ? @response.packet : "<none>"), (rtt or "-1")]
    else
      "%s (not seen leaving) -> %s" % [@probe.packet, (@response or "<none>")]
    end
  else
    "bizarre nothingness.  no probe."
  end
end