mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
profile support & add license info
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user