예제 #1
0
// del command
func delValue(c *client.GhostClient, args []string) error {
	if len(args) != 1 {
		return errors.New(fmt.Sprintf("wrong number of arguments to DEL: need 1, get %d", len(args)))
	}

	c.Del(args[0])
	return nil
}
예제 #2
0
func benchmarkServerDel(c *client.GhostClient) result {
	var wg sync.WaitGroup
	keys, vals := initTestData("get", requests, size, keyrange)
	populateTestDataServer(c, keys, vals)

	start := time.Now()
	for i := 0; i < requests; i++ {
		wg.Add(1)
		go func(i int) {
			c.Del(keys[i])
			wg.Done()
		}(i)
	}
	wg.Wait()

	latency := time.Since(start)

	return result{
		totTime: latency,
		reqSec:  float64(requests) / latency.Seconds(),
	}
}