Skip to content

Commit afbf239

Browse files
committed
improve: fix execute top command
1 parent cd673dd commit afbf239

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/scala/net/yoshinorin/gitbucket/monitoring/services/MachineResources.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ trait MachineResources {
1212
val cpuCore = Runtime.getRuntime().availableProcessors()
1313

1414
def getCpu: Try[Option[Cpu]] = Try {
15-
val resouces = (Process("top -d 0.2 -b -n 5") #| Process("grep Cpu(s)") #| Process("tail -n 1")).!!.dropAndToArray(":", ",")
15+
val resouces = (Process("top -d 0.3 -b -n 2") #| Process("grep Cpu(s)") #| Process("tail -n 1")).!!.dropAndToArray(":", ",")
1616
Some(
1717
Cpu(
1818
resouces.filter(c => c.contains("us")).headOption.getOrElse("-").replace("us", ""),

0 commit comments

Comments
 (0)