You need to add the CPU and API times together from the QuotaService to get
the CPU time in the log. The QuotaService keeps them separate while the log
adds them together. So in the log the API time reported is the API time but
the CPU time in the log is actually CPU + API time which is inconsistent
with the QuotaService. Also, it will never match perfectly since there is
still going to be some overhead from the time you call the QuotaService and
the actual end of your request by AppEngine but it should be closer.

On Tue, Dec 14, 2010 at 6:14 PM, Huy <[email protected]> wrote:

> My app is giving me warnings about my CPU usage, and I tried using the
> QuotaService functions to profile the code, but the numbers I get back are
> about a magnitude lower than the number that shows up in the request log.
>
> I called QuotaService.getCpuTimeInMegacycles() at the beginning and end of
> doPost() and I'll get like 146ms vs 1058cpu_ms in the request logs.
>
> What's going on here?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-appengine-java%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

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

Reply via email to