mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 17:15:56 +00:00
added profiling capability
This commit is contained in:
parent
00643c3ad9
commit
83a05152c3
1 changed files with 15 additions and 0 deletions
|
|
@ -1,10 +1,25 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"log"
|
||||
"os"
|
||||
"pilosa/cruncher"
|
||||
"runtime/pprof"
|
||||
)
|
||||
|
||||
var cpuprofile = flag.String("cpuprofile", "", "write cpu profile to file")
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
if *cpuprofile != "" {
|
||||
f, err := os.Create(*cpuprofile)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
pprof.StartCPUProfile(f)
|
||||
defer pprof.StopCPUProfile()
|
||||
}
|
||||
cruncher := cruncher.NewCruncher()
|
||||
cruncher.Run()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue