Package org.jgroups.protocols
Class TIME
- java.lang.Object
-
- org.jgroups.stack.Protocol
-
- org.jgroups.protocols.TIME
-
-
Field Summary
Fields Modifier and Type Field Description protected AverageMinMaxavg_up_batch_sizeprotected AverageMinMaxdown_deliveryprotected booleandown_msgsprotected java.util.concurrent.atomic.LongAddernum_batchesprotected java.util.concurrent.atomic.LongAddernum_batches_oobprotected java.util.concurrent.atomic.LongAddernum_batches_regprotected java.util.concurrent.atomic.LongAddernum_down_msgsprotected java.util.concurrent.atomic.LongAddernum_down_msgs_oobprotected java.util.concurrent.atomic.LongAddernum_down_msgs_regprotected java.util.concurrent.atomic.LongAddernum_up_msgsprotected java.util.concurrent.atomic.LongAddernum_up_msgs_oobprotected java.util.concurrent.atomic.LongAddernum_up_msgs_regprotected booleanup_batchesprotected AverageMinMaxup_delivery_batchesprotected AverageMinMaxup_delivery_msgsprotected booleanup_msgs-
Fields inherited from class org.jgroups.stack.Protocol
after_creation_hook, down_prot, ergonomics, id, local_addr, log, policies, stack, stats, up_prot
-
-
Constructor Summary
Constructors Constructor Description TIME()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectdown(Message msg)A message is sent down the stack.voidresetStats()java.lang.Objectup(Message msg)A single message was received.voidup(MessageBatch batch)Dividing the delivery time for a batch by the batch size is problematic, e.g.-
Methods inherited from class org.jgroups.stack.Protocol
accept, addPolicy, addr, addr, afterCreationHook, destroy, down, down, enableStats, getAddress, getComponents, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getPolicies, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, init, isErgonomics, level, parse, policies, providedDownServices, providedUpServices, removePolicy, requiredDownServices, requiredUpServices, resetStatistics, setAddress, setDownProtocol, setErgonomics, setId, setLevel, setPolicies, setProtocolStack, setSocketFactory, setUpProtocol, setValue, start, statsEnabled, stop, toString, up
-
-
-
-
Field Detail
-
up_delivery_msgs
protected final AverageMinMax up_delivery_msgs
-
up_delivery_batches
protected final AverageMinMax up_delivery_batches
-
avg_up_batch_size
protected final AverageMinMax avg_up_batch_size
-
down_delivery
protected final AverageMinMax down_delivery
-
down_msgs
protected boolean down_msgs
-
up_batches
protected boolean up_batches
-
up_msgs
protected boolean up_msgs
-
num_batches
protected final java.util.concurrent.atomic.LongAdder num_batches
-
num_batches_oob
protected final java.util.concurrent.atomic.LongAdder num_batches_oob
-
num_batches_reg
protected final java.util.concurrent.atomic.LongAdder num_batches_reg
-
num_down_msgs
protected final java.util.concurrent.atomic.LongAdder num_down_msgs
-
num_down_msgs_oob
protected final java.util.concurrent.atomic.LongAdder num_down_msgs_oob
-
num_down_msgs_reg
protected final java.util.concurrent.atomic.LongAdder num_down_msgs_reg
-
num_up_msgs
protected final java.util.concurrent.atomic.LongAdder num_up_msgs
-
num_up_msgs_oob
protected final java.util.concurrent.atomic.LongAdder num_up_msgs_oob
-
num_up_msgs_reg
protected final java.util.concurrent.atomic.LongAdder num_up_msgs_reg
-
-
Method Detail
-
resetStats
public void resetStats()
- Overrides:
resetStatsin classProtocol
-
down
public java.lang.Object down(Message msg)
Description copied from class:ProtocolA message is sent down the stack. Protocols may examine the message and do something (e.g. add a header) with it, before passing it down.
-
up
public java.lang.Object up(Message msg)
Description copied from class:ProtocolA single message was received. Protocols may examine the message and do something (e.g. add a header) with it before passing it up.
-
up
public void up(MessageBatch batch)
Dividing the delivery time for a batch by the batch size is problematic, e.g. if a batch of 5 is received at time 0 and the 5 messages are delivered at times 20, 40, 60, 80 and 100, then the total time is 100, divided by 5 would be 20 per message.
However, this is incorrect as it ignores the waiting times for the individual messages: e.g. message 3 gets delayed for 60 until it is processed.
The correct average delivery time per message is therefore (20+40+60+80+100)/5 = 60.
The above computation is not correct: we don't know whether a protocol looks at all messages: it may even remove some (making 'size' incorrect)!
Also, we don't know whether messages in a batch are processed in order, on by one, or whether they are processed in parallel. Therefore, times for individual messages will not be computed.
-
-