Class: Scriptroute::ProbeResponse
- Inherits:
-
Object
- Object
- Scriptroute::ProbeResponse
- Defined in:
- lib/scriptroute.rb,
lib/scriptroute/packets.rb
Overview
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.
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#rtt ⇒ Float?
Provides the apparent round trip time of this probe-response pair, or nil if either time is missing.
-
#to_s ⇒ String
this method implemented in pure ruby regardless of interpreter state.
Instance Attribute Details
#response ⇒ TimedPacket
136 137 138 |
# File 'lib/scriptroute.rb', line 136 def response @response end |
Instance Method Details
#rtt ⇒ Float?
Returns Provides the apparent round trip time of this probe-response pair, or nil if either time is missing.
138 139 140 141 142 143 144 |
# 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 ⇒ String
this method implemented in pure ruby regardless of interpreter state.
792 793 794 |
# File 'lib/scriptroute/packets.rb', line 792 def to_s "%s @%5.6f -> %s +%5.6f" % [@probe, @probe.time, (@response or "<none>"), (rtt or "-1")] end |