Add missing unlock, run debug endpoint in benchmark

This commit is contained in:
Fabian Reinartz 2017-03-02 21:53:11 +01:00
parent 21b97d1e04
commit ffb24a98f4
3 changed files with 7 additions and 1 deletions

View File

@ -5,6 +5,8 @@ import (
"fmt"
"io"
"io/ioutil"
"net/http"
_ "net/http/pprof"
"os"
"path/filepath"
"runtime"
@ -21,6 +23,9 @@ import (
)
func main() {
// Start HTTP server for pprof endpoint.
go http.ListenAndServe(":9999", nil)
root := &cobra.Command{
Use: "tsdb",
Short: "CLI tool for tsdb",

1
db.go
View File

@ -229,6 +229,7 @@ func (db *DB) compact() error {
select {
case <-db.stopc:
db.mtx.RUnlock()
return nil
default:
}

2
wal.go
View File

@ -58,7 +58,7 @@ type WAL struct {
const (
walDirName = "wal"
walSegmentSizeBytes = 64 * 1000 * 1000 // 64 MB
walSegmentSizeBytes = 256 * 1024 * 1024 // 256 MB
)
// OpenWAL opens or creates a write ahead log in the given directory.