Package org.jgroups.protocols
Class RTTHeader
java.lang.Object
org.jgroups.Header
org.jgroups.protocols.RTTHeader
- All Implemented Interfaces:
Constructable<Header>,SizeStreamable,Streamable
Header to measure round-trip times (in nanoseconds) for sync RPCs (https://issues.redhat.com/browse/JGRP-2604)
- Since:
- 5.2.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected longprotected longprotected longprotected longstatic final shortprotected longprotected longprotected longprotected long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate()Creates an instance of the class implementing this interfacedeserialize(long nanos) longTime to send a request down, from sending until just before serializationshortReturns the magic-ID.longThe time the request has spent on the network, between serializing it at the caller and de-serializing it at the receiverlongThe time a response has spent on the network, between serializing the response and de-serializing itprotected static Stringprint(long r) longTime between reception of a message and sending of a response (= time spent in application code)voidRead the state of the current object (including superclasses) from instream Note that the input stream must not be closedreceiveReq(long nanos) rspDispatched(long nanos) sendReq(long nanos) sendRsp(long nanos) serialize(long nanos) Since we don't know whether we're serializing a request or a response, the following happens: since the request is serialized _before_ the response, we check ifserialize_reqis 0: if so we set it, otherwise we setserialize_rspinstead.intReturns the size (in bytes) of the marshalled objecttoString()longThe total time for a round-triplongupReq()The time after deserializing a request until before it is dispatched to the applicationlongupRsp()The time between deserialization of a response and after dispatching to the applicationvoidwriteTo(DataOutput out) Write the entire state of the current object (including superclasses) to outstream.
-
Field Details
-
RTT_ID
public static final short RTT_ID- See Also:
-
send_req
protected long send_req -
serialize_req
protected long serialize_req -
deserialize_req
protected long deserialize_req -
receive_req
protected long receive_req -
send_rsp
protected long send_rsp -
serialize_rsp
protected long serialize_rsp -
deserialize_rsp
protected long deserialize_rsp -
rsp_dispatched
protected long rsp_dispatched
-
-
Constructor Details
-
RTTHeader
public RTTHeader()
-
-
Method Details
-
create
Description copied from interface:ConstructableCreates an instance of the class implementing this interface -
getMagicId
public short getMagicId()Description copied from class:HeaderReturns the magic-ID. If defined in jg-magic-map.xml, the IDs need to be the same- Specified by:
getMagicIdin classHeader
-
sendReq
-
serialize
Since we don't know whether we're serializing a request or a response, the following happens: since the request is serialized _before_ the response, we check ifserialize_reqis 0: if so we set it, otherwise we setserialize_rspinstead. -
deserialize
-
receiveReq
-
sendRsp
-
rspDispatched
-
totalTime
public long totalTime()The total time for a round-trip -
downRequest
public long downRequest()Time to send a request down, from sending until just before serialization -
networkRequest
public long networkRequest()The time the request has spent on the network, between serializing it at the caller and de-serializing it at the receiver -
upReq
public long upReq()The time after deserializing a request until before it is dispatched to the application -
upRsp
public long upRsp()The time between deserialization of a response and after dispatching to the application -
processingTime
public long processingTime()Time between reception of a message and sending of a response (= time spent in application code) -
networkResponse
public long networkResponse()The time a response has spent on the network, between serializing the response and de-serializing it -
toString
-
serializedSize
public int serializedSize()Description copied from interface:SizeStreamableReturns the size (in bytes) of the marshalled object -
writeTo
Description copied from interface:StreamableWrite the entire state of the current object (including superclasses) to outstream. Note that the output stream must not be closed- Throws:
IOException
-
readFrom
Description copied from interface:StreamableRead the state of the current object (including superclasses) from instream Note that the input stream must not be closed- Throws:
IOExceptionClassNotFoundException
-
print
-