add dbsize command

This commit is contained in:
bijingrui
2024-05-05 19:42:22 +08:00
committed by finley
parent dd073b0645
commit 0c6b0863f3
5 changed files with 30 additions and 0 deletions

View File

@@ -74,6 +74,11 @@ func isAuthenticated(c redis.Connection) bool {
return c.GetPassword() == config.Properties.RequirePass
}
func DbSize(c redis.Connection, db *Server) redis.Reply {
keys, _ := db.GetDBSize(c.GetDBIndex())
return protocol.MakeIntReply(int64(keys))
}
func GenGodisInfoString(section string, db *Server) []byte {
startUpTimeFromNow := getGodisRuninngTime()
switch section {