Logging slow connectionsThe request rule below captures the start time for each request and sets a connection data value called “start” for each request:-
The response rule below tests each response against a threshold, which is currently set to 6 seconds. A log entry is written to the event log for each response that takes longer to complete than the 6 second threshold. Each log entry will show the response time in seconds, the back-end node used and the full URI of the request.
The information in the event log will be useful to identify patterns in slow connections. For example, it might be that all log entries relate to RSS connections, indicating that there might be a problem with the RSS content. Comments:This public messageboard is not a forum for technical support. To report technical support problems, please contact our dedicated Support team using the instructions at the bottom of this page.
Comment from:
John Horton [Visitor]
This gives the time to first byte but what can you do to capture the time after the last byte.
Comment from:
Graham Moore [Visitor]
To capture the time after the last byte, this should work:-
$THRESHOLD = 1; # Response time in (integer) seconds above # which requests are logged. $start = connection.data.get("start"); $now = sys.time(); $diff = ($now - $start); $uri = http.getRawURL(); $node = connection.getNode(); $body = http.getResponseBody(); $newnow = sys.time(); $toend = ($newnow - $now); if ( $diff > $THRESHOLD || $toend > $THRESHOLD ) { $uri = http.getRawURL(); $node = connection.getNode(); log.info ("SLOW REQUEST (" . $diff . "s)(" . $toend . "s) " . $node . ":" . $uri ); } |
Recently...
Other Resources
|





