I want to time how long it takes the server to build a MediaWiki article. That is, the start time will be as close as possible to the time the server receives the request (not the time the client issues request). The end time will be when the server sends the page (again, not when the clie开发者_运维技巧nt receives the page).
Is there any Apache function I can access from PHP that gives me the time it took for the server to build the page?
Is there a MediaWiki hook that I can use to determine the static server time as early in the article-building process as possible? This looks promising but is for a future version of MediaWiki. I know I can determine the server time at the end of page creation. With those two times, I can generate a delta.
Thanks.
==Appended=== I've just discovered "mod_headers" (http://prefetch.net/blog/index.php/2007/01/02/measuring-apache-request-processing-time/) and its ability to create a header with the time it took to serve the request, in microseconds. However, I do not know how I could use that information since javascript cannot read it. I would love to be able to send it back to my server via AJAX and log it.
This information is embedded in every page MediaWiki generates - look for something like:
Served in 0.770 secs
in the HTML source. Is this not what you're looking for?
精彩评论