aboutsummaryrefslogtreecommitdiff
path: root/unmaintained/load_test
diff options
context:
space:
mode:
authorLei Liu <lei01.liu@horizon.ai>2019-09-29 14:17:37 +0800
committerLei Liu <lei01.liu@horizon.ai>2019-09-29 14:23:39 +0800
commit3cc084269c47d72df463760445920b45819e9feb (patch)
tree90c850277dd5ab530aae9baaf644d99bc779244c /unmaintained/load_test
parent972e881d485a1a5b4587f47ef55bbbf5182837f7 (diff)
downloadseaweedfs-3cc084269c47d72df463760445920b45819e9feb.tar.xz
seaweedfs-3cc084269c47d72df463760445920b45819e9feb.zip
master api: return http 404 when volumeId not exist
Signed-off-by: Lei Liu <lei01.liu@horizon.ai>
Diffstat (limited to 'unmaintained/load_test')
-rw-r--r--unmaintained/load_test/load_test_leveldb/load_test_leveldb.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/unmaintained/load_test/load_test_leveldb/load_test_leveldb.go b/unmaintained/load_test/load_test_leveldb/load_test_leveldb.go
index 518a5081c..43dfb0e21 100644
--- a/unmaintained/load_test/load_test_leveldb/load_test_leveldb.go
+++ b/unmaintained/load_test/load_test_leveldb/load_test_leveldb.go
@@ -16,7 +16,7 @@ import (
)
var (
- dir = flag.String("dir", "./t", "directory to store level db files")
+ dir = flag.String("dir", "./t", "directory to store level db files")
useHash = flag.Bool("isHash", false, "hash the path as the key")
dbCount = flag.Int("dbCount", 1, "the number of leveldb")
)
@@ -36,7 +36,7 @@ func main() {
var dbs []*leveldb.DB
var chans []chan string
- for d := 0 ; d < *dbCount; d++ {
+ for d := 0; d < *dbCount; d++ {
dbFolder := fmt.Sprintf("%s/%02d", *dir, d)
os.MkdirAll(dbFolder, 0755)
db, err := leveldb.OpenFile(dbFolder, opts)
@@ -49,9 +49,9 @@ func main() {
}
var wg sync.WaitGroup
- for d := 0 ; d < *dbCount; d++ {
+ for d := 0; d < *dbCount; d++ {
wg.Add(1)
- go func(d int){
+ go func(d int) {
defer wg.Done()
ch := chans[d]
@@ -60,14 +60,13 @@ func main() {
for p := range ch {
if *useHash {
insertAsHash(db, p)
- }else{
+ } else {
insertAsFullPath(db, p)
}
}
}(d)
}
-
counter := int64(0)
lastResetTime := time.Now()
@@ -101,7 +100,7 @@ func main() {
}
}
- for d := 0 ; d < *dbCount; d++ {
+ for d := 0; d < *dbCount; d++ {
close(chans[d])
}