aboutsummaryrefslogtreecommitdiff
path: root/pkg/commands/dbsize.go
blob: dbe39a44b941de10176514ea154eae00807eb80b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package commands

import (
	"redisClone/pkg/core"
)

func Dbsize(args []string, getShard func(k string) *core.Shard) interface{} {
	return dbInstance.ExecuteReadAll(func(shards []*core.Shard) interface{} {
		count := 0
		for _, shard := range shards {
			count += len(shard.Data)
		}
		return count
	})
}