Include perfstats and heap profiles in standard build

This commit is contained in:
Jakob Borg
2014-08-13 14:38:23 +02:00
parent 58381496a2
commit 213acaee3b
3 changed files with 17 additions and 12 deletions

View File

@@ -2,8 +2,6 @@
// All rights reserved. Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
// +build perfstats
package main
import (
@@ -15,7 +13,9 @@ import (
)
func init() {
go savePerfStats(fmt.Sprintf("perfstats-%d.csv", syscall.Getpid()))
if os.Getenv("STPERFSTATS") != "" {
go savePerfStats(fmt.Sprintf("perfstats-%d.csv", syscall.Getpid()))
}
}
func savePerfStats(file string) {