开发者

In the python version of Google App Engine, how do I find the urls that are taking the longest time to return?

开发者 https://www.devze.com 2023-04-05 19:09 出处:网络
I would like to create a list of the top 10 or so urls that are taking the longest real time to return from my python Google App Engine a开发者_如何转开发pplication. I am using appstats already, but t

I would like to create a list of the top 10 or so urls that are taking the longest real time to return from my python Google App Engine a开发者_如何转开发pplication. I am using appstats already, but that does not provide me with a listing of urls by the longest real time taken to return. Is there a query that I can run or a regular expression that I can type in the log filter in the online console for my app? I'm looking for something more elegant that downloading and parsing all of my logs.


There's nothing for that out-of-the-box. You have several options. An easy one is to stash a list of (url, max-time) pairs in memcache. A slightly harder one is to customize appstats.

The rub is that a handler can run long for several reasons that aren't under your direct control (e.g., a request that causes a new instance to be spun up is going to take longer), so knowing what the longest one is might be of little help if the longest was a fluke.


You can work on a good Yslow score. If you make your webpages so that they get a good score in Yslow then I think you have a good case. You can also take the usual measures for optimization i.e. memcache, instance variables, javascript, more efficient data structures and such. Specifically if you get a score such as 70 % in yslow then it's probably alright.


Go to the Google App Engine dashboard and click on Logs in the left panel. Then select the All Requests radio button and expand the options box. Then type in ( ms=)([0-9]{5,}|[5-9][0-9]{3}) in the regex box. This will return all logs where ms=5000+ milliseconds. You can then tune the regex expression to return then number of logs you are interested in.

0

精彩评论

暂无评论...
验证码 换一张
取 消