(name, file string)
| 190 | } |
| 191 | |
| 192 | func writeProfile(name, file string) error { |
| 193 | p := pprof.Lookup(name) |
| 194 | log.Info("Writing profile records", "count", p.Count(), "type", name, "dump", file) |
| 195 | f, err := os.Create(expandHome(file)) |
| 196 | if err != nil { |
| 197 | return err |
| 198 | } |
| 199 | defer f.Close() |
| 200 | return p.WriteTo(f, 0) |
| 201 | } |
| 202 | |
| 203 | // expands home directory in file paths. |
| 204 | // ~someuser/tmp will not be expanded. |
no test coverage detected