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

Method player

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

Source from the content-addressed store, hash-verified

46}
47
48func (tc *TestListTestCase) 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_list_%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 u.Lpush(c, "val_"+strconv.Itoa(r.Next()))
67 ops.Incr()
68 }
69 }
70 for j := 0; j < tc.nvals; j++ {
71 for _, u := range us {
72 u.Lpop(c)
73 ops.Incr()
74 }
75 }
76 }
77 for _, u := range us {
78 u.Del(c, false)
79 ops.Incr()
80 }
81}

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
LpushMethod · 0.80
LpopMethod · 0.80
NewConnFunction · 0.70
GetMethod · 0.45
DelMethod · 0.45
IncrMethod · 0.45

Tested by

no test coverage detected