MCPcopy
hub / github.com/CodisLabs/codis / player

Method player

extern/deprecated/redis-test/test_hset.go:48–80  ·  view source on GitHub ↗
(gid int, tg *TestGroup, tags *ZeroTags)

Source from the content-addressed store, hash-verified

46}
47
48func (tc *TestHsetTestCase) player(gid int, tg *TestGroup, tags *ZeroTags) {
49 tg.PlayerWait()
50 defer tg.PlayerDone()
51 c := NewConn(tc.proxy)
52 defer c.Close()
53 us := UnitSlice(make([]*Unit, tc.nkeys))
54 for i := 0; i < len(us); i++ {
55 key := fmt.Sprintf("test_hset_%d_%d_tag{%s}", gid, i, tags.Get(i))
56 us[i] = NewUnit(key)
57 }
58 for _, u := range us {
59 u.Del(c, false)
60 ops.Incr()
61 }
62 for i := 0; i < tc.round; i++ {
63 r := &Rand{time.Now().UnixNano()}
64 for j := 0; j < tc.nvals; j++ {
65 for _, u := range us {
66 s := "val_" + strconv.Itoa(r.Next())
67 u.Hset(c, s, s)
68 ops.Incr()
69 }
70 }
71 for _, u := range us {
72 u.GetHset(c)
73 ops.Incr()
74 }
75 }
76 for _, u := range us {
77 u.Del(c, true)
78 ops.Incr()
79 }
80}

Callers 1

mainMethod · 0.95

Calls 12

CloseMethod · 0.95
NextMethod · 0.95
UnitSliceTypeAlias · 0.85
NewUnitFunction · 0.85
PlayerWaitMethod · 0.80
PlayerDoneMethod · 0.80
HsetMethod · 0.80
GetHsetMethod · 0.80
NewConnFunction · 0.70
GetMethod · 0.45
DelMethod · 0.45
IncrMethod · 0.45

Tested by

no test coverage detected