Frage

(ACF9)

Unless there's an option I'm missing, the "Log Slow Pages Taking Longer Than [n] Seconds" setting isn't useful for front-controller based sites (e.g., Model-Glue, FW/1, Fusebox, Mach-II, etc.).

For instance, in a Mura/Framework-One site, I just end up with:

"Warning","jrpp-186","04/25/13","15:26:36",,"Thread: jrpp-186, processing template: /home/mysite/public_html_cms/wwwroot/index.cfm, completed in 11 seconds, exceeding the 10 second warning limit"
"Warning","jrpp-196","04/25/13","15:27:11",,"Thread: jrpp-196, processing template: /home/mysite/public_html_cms/wwwroot/index.cfm, completed in 59 seconds, exceeding the 10 second warning limit"
"Warning","jrpp-214","04/25/13","15:28:56",,"Thread: jrpp-214, processing template: /home/mysite/public_html_cms/wwwroot/index.cfm, completed in 32 seconds, exceeding the 10 second warning limit"
"Warning","jrpp-134","04/25/13","15:31:53",,"Thread: jrpp-134, processing template: /home/mysite/public_html_cms/wwwroot/index.cfm, completed in 11 seconds, exceeding the 10 second warning limit"

Is there some way to get query string or post details in there, or is there another way to get what I'm after?

War es hilfreich?

Lösung

You can easily add some logging to your application for any requests that take longer than 10 seconds.

In onRequestStart():

    request.startTime = getTickCount();

In onRequestEnd():

    request.endTime = getTickCount();

    if (request.endTime - request.startTime > 10000){
        writeLog(cgi.QUERY_STRING);
    }

Andere Tipps

If you're writing a Mach-II, FW/1 or ColdBox application, it's trivial to write a "plugin" that runs on every request which captures the URL or FORM variables passed in the request and stores that in a simple database table or log file. (You can even capture session.userID or IP address or whatever you may need.) If you're capturing to a database table, you'll probably not want any indexes to optimize for performance and you'll need to rotate that table so you're not trying to do high-speed inserts on a table with tens of millions of rows.

  • In Mach-II, you'd write a plugin.
  • In FW/1, you'd put a call to a controller which handles this into setupRequest() in your application.cfc.
  • In ColdBox, you'd write an interceptor.

The idea is that the log just tells you what pages arw xonsostently slow sp ypu can do your own performance tuning. Turn on debugging for further details for a start.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top