Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
eadd9c77
Commit
eadd9c77
authored
Jun 14, 2022
by
Zheng Jie
Browse files
[代码完善](master): 代码优化
parent
9f0eb9fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/MonitorServiceImpl.java
View file @
eadd9c77
...
...
@@ -148,8 +148,8 @@ public class MonitorServiceImpl implements MonitorService {
cpuInfo
.
put
(
"logic"
,
processor
.
getLogicalProcessorCount
()
+
"个逻辑CPU"
);
// CPU信息
long
[]
prevTicks
=
processor
.
getSystemCpuLoadTicks
();
// 等待
1
秒...
Util
.
sleep
(
10
00
);
// 等待
300毫
秒...
Util
.
sleep
(
3
00
);
long
[]
ticks
=
processor
.
getSystemCpuLoadTicks
();
long
user
=
ticks
[
CentralProcessor
.
TickType
.
USER
.
getIndex
()]
-
prevTicks
[
CentralProcessor
.
TickType
.
USER
.
getIndex
()];
long
nice
=
ticks
[
CentralProcessor
.
TickType
.
NICE
.
getIndex
()]
-
prevTicks
[
CentralProcessor
.
TickType
.
NICE
.
getIndex
()];
...
...
Write
Preview
Supports
Markdown
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