adelton

Apache2::RequestRec::Time

Bring microseconds to Apache2::RequestRec

Synopsis

use Apache2::RequestRec::Time ();

# have Apache2::RequestRec object $r

my $duration = $r->request_duration_microseconds();

Description

The Apache2::RequestRec::Time extends the Apache2::RequestRec functionality with method request_duration_microseconds(). That makes it possible to retrieve from Perl information equivalent to Custom Log Format's %D: the time taken to serve the request, in microseconds.

Api

request_duration_microseconds($r)

Parameters: $r: Apache2::RequestRec object

Returns: time taken to serve the request, in microseconds. Actually, it's time since $r->request_time(). It is equivalent to %D in Custom Log Formats.

request_duration($r)

Parameters: $r: Apache2::RequestRec object

Returns: time taken to serve the request, in seconds. Equivalent to %T in Custom Log Formats.

request_time_microseconds($r)

Parameters: $r: Apache2::RequestRec object

Returns: time the request was received, in microseconds since epoch. This is microsecond-ish variant of $r->request_time().

Version

1.1

Available from

http://www.adelton.com/perl/Apache2-RequestRec-Time/

Author

(c) 2009--2011 Jan Pazdziora.

Contact the author at jpx dash perl at adelton dot com.

License

Licensed under the Apache License, Version 2.0:

http://www.apache.org/licenses/LICENSE-2.0