Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
2630b65f
Commit
2630b65f
authored
May 13, 2022
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复等待时间
parent
55785ef7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
AspectLogTime.java
...rc/main/java/com/yanzuoguang/cloud/aop/AspectLogTime.java
+5
-5
AspectUrlCountVo.java
...main/java/com/yanzuoguang/cloud/aop/AspectUrlCountVo.java
+6
-6
No files found.
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/AspectLogTime.java
View file @
2630b65f
...
...
@@ -91,13 +91,13 @@ public class AspectLogTime implements ThreadNext.Next, InitializingBean {
/**
* 结束
*
* @param url
请求地址
* @param time 执行时间
* @param is
Log 是否记录日志
* @param url
请求地址
* @param time
执行时间
* @param is
Error 是否错误
*/
public
void
finish
(
String
url
,
long
time
,
boolean
is
Log
)
{
public
void
finish
(
String
url
,
long
time
,
boolean
is
Error
)
{
AspectUrlCountVo
count
=
getCount
(
url
);
count
.
addFinish
(
time
,
is
Log
);
count
.
addFinish
(
time
,
is
Error
);
}
@Override
...
...
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/AspectUrlCountVo.java
View file @
2630b65f
...
...
@@ -12,7 +12,7 @@ public class AspectUrlCountVo {
private
volatile
String
url
;
private
volatile
int
startCount
;
private
volatile
int
endCount
;
private
volatile
int
log
Count
;
private
volatile
int
error
Count
;
private
volatile
long
totalTime
;
private
volatile
long
avgTime
;
private
volatile
long
minTime
=
Long
.
MAX_VALUE
;
...
...
@@ -32,7 +32,7 @@ public class AspectUrlCountVo {
synchronized
(
lockFinish
)
{
this
.
endCount
++;
if
(
isLog
)
{
this
.
log
Count
++;
this
.
error
Count
++;
}
this
.
totalTime
+=
time
;
this
.
minTime
=
Math
.
min
(
time
,
this
.
minTime
);
...
...
@@ -65,12 +65,12 @@ public class AspectUrlCountVo {
this
.
endCount
=
endCount
;
}
public
int
get
Log
Count
()
{
return
log
Count
;
public
int
get
Error
Count
()
{
return
error
Count
;
}
public
void
set
LogCount
(
int
log
Count
)
{
this
.
logCount
=
log
Count
;
public
void
set
ErrorCount
(
int
error
Count
)
{
this
.
errorCount
=
error
Count
;
}
public
long
getTotalTime
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment