StopProfile closes the CPU and memory profiles if they are running.
()
| 57 | |
| 58 | // StopProfile closes the CPU and memory profiles if they are running. |
| 59 | func StopProfile() { |
| 60 | if prof.cpu != nil { |
| 61 | pprof.StopCPUProfile() |
| 62 | prof.cpu.Close() |
| 63 | log.Info("CPU profiling stopped") |
| 64 | } |
| 65 | if prof.mem != nil { |
| 66 | pprof.WriteHeapProfile(prof.mem) |
| 67 | prof.mem.Close() |
| 68 | log.Info("memory profiling stopped") |
| 69 | } |
| 70 | } |