What are the exact meaning of time values in GAE log fields?

前端 未结 1 1920
遇见更好的自我
遇见更好的自我 2021-01-07 01:38

I see some enigmatic time fields in the standard Google app-engine logs which make me curious:

2011-05-09 21:56:00.577 /whatever 200 211ms 775cpu_ms 589api_c         


        
1条回答
  •  时光取名叫无心
    2021-01-07 02:33

    211ms: It's the response's time, as it will be perceived by the user who requested the page. You will try to decrease it, in order to improve the speed of your website.

    775cpu_ms: According to the App Engine documentation, "CPU time is reported in "seconds," which is equivalent to the number of CPU cycles that can be performed by a 1.2 GHz Intel x86 processor in that amount of time. The actual number of CPU cycles spent varies greatly depending on conditions internal to App Engine, so this number is adjusted for reporting purposes using this processor as a reference measurement."

    Then, it's normal not to have the "real" time: it should be different from what you measured with System.currentTimeMillis() because it's adjusted. Instead, you should use the Quota API to monitor the CPU usage: see documentation here. CPU time is billable (the free quota is 6.5 CPU-hours per day, and you can pay for more CPU time). Then, you will try to decrease it, in order to pay less.

    589api_cpu_ms: It's the adjuested CPU time spent by the API usage (Datastore, User API, etc.)

    0 讨论(0)
提交回复
热议问题