Add missing unlock, run debug endpoint in benchmark
This commit is contained in:
parent
21b97d1e04
commit
ffb24a98f4
|
@ -5,6 +5,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"net/http"
|
||||||
|
_ "net/http/pprof"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
@ -21,6 +23,9 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
// Start HTTP server for pprof endpoint.
|
||||||
|
go http.ListenAndServe(":9999", nil)
|
||||||
|
|
||||||
root := &cobra.Command{
|
root := &cobra.Command{
|
||||||
Use: "tsdb",
|
Use: "tsdb",
|
||||||
Short: "CLI tool for tsdb",
|
Short: "CLI tool for tsdb",
|
||||||
|
|
1
db.go
1
db.go
|
@ -229,6 +229,7 @@ func (db *DB) compact() error {
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-db.stopc:
|
case <-db.stopc:
|
||||||
|
db.mtx.RUnlock()
|
||||||
return nil
|
return nil
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
2
wal.go
2
wal.go
|
@ -58,7 +58,7 @@ type WAL struct {
|
||||||
|
|
||||||
const (
|
const (
|
||||||
walDirName = "wal"
|
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.
|
// OpenWAL opens or creates a write ahead log in the given directory.
|
||||||
|
|
Loading…
Reference in New Issue