Dont write pprof info in addblock.
dont write pprof info in addblock (ok drahn); and make progress a little more silent
This commit is contained in:
parent
d00ccc0d3c
commit
96ded50f6b
1 changed files with 4 additions and 12 deletions
|
@ -18,7 +18,6 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"runtime/pprof"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ShaHash btcwire.ShaHash
|
type ShaHash btcwire.ShaHash
|
||||||
|
@ -146,26 +145,19 @@ func main() {
|
||||||
blkP.complete <- true
|
blkP.complete <- true
|
||||||
db.InsertBlock(blkP.blk)
|
db.InsertBlock(blkP.blk)
|
||||||
|
|
||||||
if cfg.Progress && eheight%int64(1) == 0 {
|
if cfg.Progress && eheight%int64(10000) == 0 {
|
||||||
log.Infof("Processing block %v", eheight)
|
log.Infof("Processing block %v", eheight)
|
||||||
}
|
}
|
||||||
eheight++
|
eheight++
|
||||||
|
|
||||||
if eheight%2000 == 0 {
|
|
||||||
f, err := os.Create(fmt.Sprintf("profile.%d", eheight))
|
|
||||||
if err == nil {
|
|
||||||
pprof.WriteHeapProfile(f)
|
|
||||||
f.Close()
|
|
||||||
} else {
|
|
||||||
log.Warnf("profile failed %v", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if cfg.Progress {
|
||||||
|
log.Infof("Processing block %v", eheight)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func processBuf(idx int, bufqueue chan *bufQueue, blkqueue chan *blkQueue) {
|
func processBuf(idx int, bufqueue chan *bufQueue, blkqueue chan *blkQueue) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue