@Component public class ProcessingTimeStrategy extends Object implements InvocationTimeoutStrategy
Cumulative Processing Time
not depend on time synchronization
but lost network and framework outside of servicecomb processing time
consumer: c
producer: p
---------------------------------------------------------------
| process 2 |
| c-send(T5) c-send(T8) |
| ↑ ↑ |
| p-start(T3) → c-start(T4) → p-operation(T6) → c-start(T7)|
-----↑--------------------------------------------------------
↑
-----↑-----------------
| ↑ process 1 |
| c-send(T2) |
| ↑ |
| c-start(T1) |
------------------------
T2 timeout: T2 - T1
T3 timeout: (T2 - T1) + (T3 - T3)
T4 timeout: (T2 - T1) + (T4 - T3)
T5 timeout: (T2 - T1) + (T5 - T3)
T6 timeout: (T2 - T1) + (T6 - T3)
T7 timeout: (T2 - T1) + (T7 - T3)
T8 timeout: (T2 - T1) + (T8 - T3)
......
| Modifier and Type | Field and Description |
|---|---|
static String |
CHAIN_PROCESSING |
static String |
CHAIN_START_TIME |
static String |
NAME |
CHAIN_ALREADY_TIMED_OUT| Constructor and Description |
|---|
ProcessingTimeStrategy() |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeSendRequest(Invocation invocation) |
long |
calculateElapsedNanoTime(Invocation invocation) |
String |
name() |
ProcessingTimeStrategy |
setTicker(com.google.common.base.Ticker ticker) |
void |
start(Invocation invocation) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitalreadyTimeout, checkTimeout, finishBusinessMethod, startBusinessMethod, startHandlers, startRunInExecutorpublic static final String NAME
public static final String CHAIN_START_TIME
public static final String CHAIN_PROCESSING
public ProcessingTimeStrategy setTicker(com.google.common.base.Ticker ticker)
public String name()
name in interface InvocationTimeoutStrategypublic void start(Invocation invocation)
start in interface InvocationTimeoutStrategypublic void beforeSendRequest(Invocation invocation)
beforeSendRequest in interface InvocationTimeoutStrategypublic long calculateElapsedNanoTime(Invocation invocation)
calculateElapsedNanoTime in interface InvocationTimeoutStrategyCopyright © 2017–2022 The Apache Software Foundation. All rights reserved.