Correct delete objects
parent
052838d242
commit
cd933a2d85
|
@ -32,7 +32,11 @@ func bench(cephconn *Cephconnection, osddevice Device, buffs *[][]byte, offset [
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
threadresult := make(chan string, params.threadsCount)
|
threadresult := make(chan string, params.threadsCount)
|
||||||
var osdresults, objectnames []string
|
var osdresults, objectnames []string
|
||||||
|
defer func() {
|
||||||
|
for _, object := range objectnames {
|
||||||
|
cephconn.ioctx.Delete(object)
|
||||||
|
}
|
||||||
|
}()
|
||||||
// calculate object for each thread
|
// calculate object for each thread
|
||||||
for suffix := 0; len(objectnames) < int(params.threadsCount); suffix++ {
|
for suffix := 0; len(objectnames) < int(params.threadsCount); suffix++ {
|
||||||
name := "bench_" + strconv.Itoa(suffix)
|
name := "bench_" + strconv.Itoa(suffix)
|
||||||
|
@ -52,7 +56,7 @@ func bench(cephconn *Cephconnection, osddevice Device, buffs *[][]byte, offset [
|
||||||
|
|
||||||
func bench_thread(cephconn *Cephconnection, osddevice Device, buffs [][]byte, offsets []int64, params *Params,
|
func bench_thread(cephconn *Cephconnection, osddevice Device, buffs [][]byte, offsets []int64, params *Params,
|
||||||
result chan string, objname string) {
|
result chan string, objname string) {
|
||||||
defer cephconn.ioctx.Delete(objname)
|
|
||||||
starttime := time.Now()
|
starttime := time.Now()
|
||||||
var latencies []time.Duration
|
var latencies []time.Duration
|
||||||
endtime := starttime.Add(params.duration)
|
endtime := starttime.Add(params.duration)
|
||||||
|
@ -122,7 +126,6 @@ func main() {
|
||||||
if params.parallel == true {
|
if params.parallel == true {
|
||||||
go func() {
|
go func() {
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
time.Sleep(time.Second)
|
|
||||||
close(results)
|
close(results)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue