App Engine - Java AppStats - It shows all requests as cpu time of 0
All lines in my AppStats look like this: real=19ms cpu=开发者_如何学Python0ms api=0ms overhead=0ms
, it has the correct real time, but the other values are always 0. Anyone have this problem before or know how to fix this?
My guess would be that since the information it is showing is the same as is available in logs even when AppStats isn't set up, that you've got the Administrative Interface installed ok, but not the filter.
Make sure your web.xml is setup like below. Working example here.
<servlet>
<servlet-name>appstats</servlet-name>
<servlet-class>com.google.appengine.tools.appstats.AppstatsServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>appstats</servlet-name>
<url-pattern>/appstats/*</url-pattern>
</servlet-mapping>
<filter>
<filter-name>appstats</filter-name>
<filter-class>com.google.appengine.tools.appstats.AppstatsFilter</filter-class>
<init-param>
<param-name>logMessage</param-name>
<param-value>Appstats available: /appstats/details?time={ID}</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>appstats</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<security-constraint>
<display-name>appstatsConstraint</display-name>
<web-resource-collection>
<web-resource-name>appstatsCollection</web-resource-name>
<url-pattern>/appstats/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
精彩评论