public class NetworkingStopWatch extends Object
0. setNewContext - phaese0
1. Sending request
1.1. 1st measure: urlConnection.getOutputStream(): Open connection for - resume and suspend NET timer (on 2-3 places - plain HTTP request and AMF ones)
step1_start
step2_end
1.2. 2nd real data: resume & suspend NET timer
step3_start
step4_end
1.3. Store request time
2. Intermediate timer - for non-data actions after sending request and before asking for response data.
Primarily for new XML Document creation...
2.1. Start right after request is sent (interim, 1)
step5_
3. Get response
3.1.1 Get response code - suspend interm. timer and resume NET time; After get - resume back to interim. timer. (interim, 2)
step6_start
step7_end
3.1.2 Get response data - stop interim timer and start NET timer. At the end stop NET timer.
step8_start
step9_end
Note: For HTTP get response code and body are on same place so no interim timer resume.
| Modifier and Type | Field and Description |
|---|---|
static org.apache.log4j.Logger |
logTimer |
static String |
netTimeLoggerStr |
| Constructor and Description |
|---|
NetworkingStopWatch(String templateActionName) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.commons.lang3.time.StopWatch |
getNetTimer()
Return used StopWatch for network.
|
long |
getNetworkingTime() |
long |
getTimeBetweenReqAndResponse() |
void |
setStateFromBeforeStep1ToAfterStep4()
Set internal state from initial state (after step 0, before request) to state after step 4 (request data sent)
|
void |
step0_SetNewContext(String actionNameStepWithNumber)
Reset context for timer reuse.
|
void |
step1_OpenConnectionForRequest() |
void |
step2_OpenedConnectionForRequest() |
void |
step3_StartSendingRequest() |
void |
step4_EndSendingRequest() |
void |
step5_StartInterimTimer()
Start timer for work between end of request and begin to ask for response data
|
void |
step6_StartGetResponseCode() |
void |
step7_EndGetResponseCode()
End get response code and resume back interim timer
|
void |
step8_stopInterimTimeAndStartReceivingResponseData()
Stop timer between req.
|
void |
step9_endReceivingResponseData() |
public static final String netTimeLoggerStr
public static final org.apache.log4j.Logger logTimer
public NetworkingStopWatch(String templateActionName)
public long getNetworkingTime()
public long getTimeBetweenReqAndResponse()
public void step0_SetNewContext(String actionNameStepWithNumber)
actionNameStepWithNumber - public void step1_OpenConnectionForRequest()
public void step2_OpenedConnectionForRequest()
public void step3_StartSendingRequest()
public void step4_EndSendingRequest()
public void setStateFromBeforeStep1ToAfterStep4()
public void step5_StartInterimTimer()
public void step6_StartGetResponseCode()
public void step7_EndGetResponseCode()
public void step8_stopInterimTimeAndStartReceivingResponseData()
public void step9_endReceivingResponseData()
public org.apache.commons.lang3.time.StopWatch getNetTimer()
Copyright © 2017 Axway Software. All rights reserved.