The request rule below captures the start time for each request and sets a connection data value called “start” for each request:-
$tm = sys.time.highres();
# Don't store $tm directly, use sprintf to preserve precision
connection.data.set("start", string.sprintf( "%f", $tm ) );
The following response rule then 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.