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
6dcdfdc0
Commit
6dcdfdc0
authored
May 13, 2022
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复等待时间
parent
11852664
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
13 deletions
+27
-13
AspectLogTime.java
...rc/main/java/com/yanzuoguang/cloud/aop/AspectLogTime.java
+6
-0
AspectUrlCountVo.java
...main/java/com/yanzuoguang/cloud/aop/AspectUrlCountVo.java
+21
-13
No files found.
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/AspectLogTime.java
View file @
6dcdfdc0
...
@@ -7,6 +7,8 @@ import org.springframework.beans.factory.InitializingBean;
...
@@ -7,6 +7,8 @@ import org.springframework.beans.factory.InitializingBean;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -27,6 +29,10 @@ public class AspectLogTime implements ThreadNext.Next, InitializingBean {
...
@@ -27,6 +29,10 @@ public class AspectLogTime implements ThreadNext.Next, InitializingBean {
@Override
@Override
public
boolean
next
()
{
public
boolean
next
()
{
List
<
AspectUrlCountVo
>
rowList
=
new
ArrayList
<>(
memoryCache
.
getValues
());
List
<
AspectUrlCountVo
>
rowList
=
new
ArrayList
<>(
memoryCache
.
getValues
());
if
(
rowList
.
isEmpty
())
{
return
true
;
}
rowList
.
sort
(
Comparator
.
comparingInt
(
AspectUrlCountVo:
:
getStartCount
));
System
.
out
.
println
(
CollectionString
.
getCollectionString
(
"接口执行次数:"
,
rowList
));
System
.
out
.
println
(
CollectionString
.
getCollectionString
(
"接口执行次数:"
,
rowList
));
return
true
;
return
true
;
}
}
...
...
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/AspectUrlCountVo.java
View file @
6dcdfdc0
...
@@ -7,11 +7,12 @@ package com.yanzuoguang.cloud.aop;
...
@@ -7,11 +7,12 @@ package com.yanzuoguang.cloud.aop;
*/
*/
public
class
AspectUrlCountVo
{
public
class
AspectUrlCountVo
{
private
volatile
String
url
;
private
volatile
String
url
;
private
volatile
long
startCount
;
private
volatile
int
startCount
;
private
volatile
long
endCount
;
private
volatile
int
endCount
;
private
volatile
long
totalTime
;
private
volatile
long
totalTime
;
private
volatile
long
minTime
;
private
volatile
int
avgTime
;
private
volatile
long
maxTime
;
private
volatile
int
minTime
;
private
volatile
int
maxTime
;
public
AspectUrlCountVo
(
String
url
)
{
public
AspectUrlCountVo
(
String
url
)
{
this
.
url
=
url
;
this
.
url
=
url
;
...
@@ -25,19 +26,19 @@ public class AspectUrlCountVo {
...
@@ -25,19 +26,19 @@ public class AspectUrlCountVo {
this
.
url
=
url
;
this
.
url
=
url
;
}
}
public
long
getStartCount
()
{
public
int
getStartCount
()
{
return
startCount
;
return
startCount
;
}
}
public
void
setStartCount
(
long
startCount
)
{
public
void
setStartCount
(
int
startCount
)
{
this
.
startCount
=
startCount
;
this
.
startCount
=
startCount
;
}
}
public
long
getEndCount
()
{
public
int
getEndCount
()
{
return
endCount
;
return
endCount
;
}
}
public
void
setEndCount
(
long
endCount
)
{
public
void
setEndCount
(
int
endCount
)
{
this
.
endCount
=
endCount
;
this
.
endCount
=
endCount
;
}
}
...
@@ -49,20 +50,27 @@ public class AspectUrlCountVo {
...
@@ -49,20 +50,27 @@ public class AspectUrlCountVo {
this
.
totalTime
=
totalTime
;
this
.
totalTime
=
totalTime
;
}
}
public
long
getMinTime
()
{
public
int
getAvgTime
()
{
return
avgTime
;
}
public
void
setAvgTime
(
int
avgTime
)
{
this
.
avgTime
=
avgTime
;
}
public
int
getMinTime
()
{
return
minTime
;
return
minTime
;
}
}
public
void
setMinTime
(
long
minTime
)
{
public
void
setMinTime
(
int
minTime
)
{
this
.
minTime
=
minTime
;
this
.
minTime
=
minTime
;
}
}
public
long
getMaxTime
()
{
public
int
getMaxTime
()
{
return
maxTime
;
return
maxTime
;
}
}
public
void
setMaxTime
(
long
maxTime
)
{
public
void
setMaxTime
(
int
maxTime
)
{
this
.
maxTime
=
maxTime
;
this
.
maxTime
=
maxTime
;
}
}
}
}
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