Yes, that's true. If you try this:

task_t0 = None

...


def main(argv):
  global task_t0
  task_t0 = time.time()

You'll get a measurement per request as early as we can make it. For
warming requests, it might still be worth measuring the import time

import time
import_start = time.time()
... other imports
import_duration = time.time() - import_start

The import_duration global should persist and tell you how long this
instance's imports took to process. Subsequent requests on that
instance don't do the imports.

Nick Verne

On Tue, Jun 21, 2011 at 10:49 AM, Waleed Abdulla <wal...@ninua.com> wrote:
>> A more useful measurement might be to set task_t0 as a global variable
>> at the top of your file, with only the import of "time" preceding it
>
> Wouldn't that cause the 2nd, 3rd, ...nth requests to the same handler to
> show wrong values? I see why setting task_t0 at the top of the file would
> apply if it was the first request that causes the handler to be loaded. But
> this is happening on an ongoing basis for all requests, not only the first
> for that handler.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to google-appengine@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to