Skip to content

Commit

Permalink
In profile dump file - use a time format supporting all file systems (#…
Browse files Browse the repository at this point in the history
…1945)

* Use a time format without ":" to support all file systems

* go fmt
  • Loading branch information
michaelsutton authored Feb 12, 2022
1 parent 82f0a4d commit f58aeb4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions util/profiling/profiling.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ import (
)

// heapDumpFileName is the name of the heap dump file. We want every run to have its own
// file, so we append the timestamp of the program launch time to the file name.
var heapDumpFileName = fmt.Sprintf("heap-%s.pprof", time.Now().Format(time.RFC3339))
// file, so we append the timestamp of the program launch time to the file name (note the
// custom format for compliance with file name rules on all OSes).
var heapDumpFileName = fmt.Sprintf("heap-%s.pprof", time.Now().Format("01-02-2006T15.04.05"))

// Start starts the profiling server
func Start(port string, log *logger.Logger) {
Expand All @@ -43,7 +44,7 @@ func TrackHeap(appDir string, log *logger.Logger) {
log.Errorf("Could not create heap dumps folder at %s", dumpFolder)
return
}
const limitInGigabytes = 8
const limitInGigabytes = 7 // We want to support 8 GB RAM, so we profile at 7
trackHeapSize(limitInGigabytes*1024*1024*1024, dumpFolder, log)
})
}
Expand Down

0 comments on commit f58aeb4

Please sign in to comment.