ceph-gobench/ceph-gobench.go

43 lines
716 B
Go
Raw Normal View History

package main
import (
2019-02-19 15:46:00 +03:00
"fmt"
"log"
2019-02-14 17:35:18 +03:00
"math/rand"
2019-02-14 19:18:43 +03:00
"time"
)
2019-02-19 18:26:52 +03:00
//future feature
2019-02-19 15:46:00 +03:00
func makepreudorandom() {
a := make([]int, 0, 4096/4)
for i := 0; i < 4096; i += 4 {
a = append(a, i)
}
rand.Shuffle(len(a), func(i, j int) {
a[i], a[j] = a[j], a[i]
})
fmt.Println(a)
}
func main() {
2019-02-14 17:35:18 +03:00
params := Route()
cephconn := connectioninit(params)
2019-02-14 17:35:18 +03:00
defer cephconn.conn.Shutdown()
2019-02-14 17:59:40 +03:00
2019-02-14 19:18:43 +03:00
// https://tracker.ceph.com/issues/24114
time.Sleep(time.Millisecond * 100)
2019-02-14 17:35:18 +03:00
var buffs [][]byte
2019-02-14 17:59:40 +03:00
for i := 0; i < 2*params.threadsCount; i++ {
buffs = append(buffs, make([]byte, params.blocksize))
2019-02-14 17:35:18 +03:00
}
for num := range buffs {
_, err := rand.Read(buffs[num])
if err != nil {
log.Fatalln(err)
}
}
2019-02-20 16:54:39 +03:00
GetOsds(cephconn, params)
}