Skip to content

Commit

Permalink
A 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenorzz committed Apr 29, 2022
1 parent 8e3d770 commit e4525fb
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions task/Task.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ func obRAMUsage() {
}
total := 0.0
free := 0.0
available := 0.0
for i, line := range strings.Split(utils.ClearNewline(stdout.String()), "\n") {
fields := strings.Fields(line)
if i == 0 {
Expand All @@ -215,15 +214,11 @@ func obRAMUsage() {
} else if i == 2 && fields[0] == "MemAvailable:" {
val, err := strconv.ParseFloat(fields[1], 64)
if err == nil {
available += val // tally up all the numbers to get total ticks
free += val // tally up all the numbers to get total ticks
}
}
}

if available > 0 {
free = available
}

ramUsage := 100 * (total - free) / total
agent := model.Agent{
Type: model.TypeRAM,
Expand Down

0 comments on commit e4525fb

Please sign in to comment.