profile support & add license info

This commit is contained in:
wenshao
2012-10-09 10:52:29 +08:00
parent e80fac8f91
commit fcbdefa8fe
15 changed files with 294 additions and 52 deletions
@@ -122,6 +122,7 @@ public class WebStatFilter implements Filter {
if (isProfileEnable()) {
Profiler.initLocal();
Profiler.enter(requestURI, Profiler.PROFILE_TYPE_WEB);
}
// 第一次访问时,uriStat这里为null,是为了防止404攻击。
@@ -189,6 +190,8 @@ public class WebStatFilter implements Filter {
WebRequestStat.set(null);
if (isProfileEnable()) {
Profiler.release(nanos);
Map<ProfileEntryKey, ProfileEntryReqStat> requestStatsMap = Profiler.getStatsMap();
uriStat.getProfiletat().record(requestStatsMap);
Profiler.removeLocal();
@@ -143,8 +143,6 @@ public class WebURIStat {
if (requestStat != null) {
this.setLastAccessTimeMillis(requestStat.getStartMillis());
}
Profiler.enter(uri, Profiler.PROFILE_TYPE_WEB);
}
public void afterInvoke(Throwable error, long nanos) {
@@ -216,8 +214,6 @@ public class WebURIStat {
}
currentLocal.set(null);
Profiler.release(nanos);
}
public int getRunningCount() {