Skip to content

Commit

Permalink
Merge pull request #1204 from monicasarbu/small_fixes
Browse files Browse the repository at this point in the history
Solve panic in topbeat
  • Loading branch information
andrewkroh committed Mar 22, 2016
2 parents 5827b44 + cc8c382 commit 74e6487
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion topbeat/system/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func GetProcessEvent(process *Process, last *Process) common.MapStr {

func GetProcCpuPercentage(last *Process, current *Process) float64 {

if last != nil {
if last != nil && current != nil {

delta_proc := (current.Cpu.User - last.Cpu.User) + (current.Cpu.Sys - last.Cpu.Sys)
delta_time := current.Ctime.Sub(last.Ctime).Nanoseconds() / 1e6 // in milliseconds
Expand Down

0 comments on commit 74e6487

Please sign in to comment.