wanshenmean
2026-03-18 5c766d7e5c969b7530a014ded771973e242f25e0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
namespace WIDESEAWCS_RedisService.Monitoring
{
    public interface IRedisMonitorService
    {
        /// <summary>
        /// 获取Redis服务器信息
        /// </summary>
        Dictionary<string, string> GetServerInfo();
 
        /// <summary>
        /// 获取内存使用信息
        /// </summary>
        RedisMemoryInfo GetMemoryInfo();
 
        /// <summary>
        /// 健康检查
        /// </summary>
        bool HealthCheck();
 
        /// <summary>
        /// 获取数据库Key数量
        /// </summary>
        long GetDbSize();
 
        /// <summary>
        /// 获取客户端连接数
        /// </summary>
        long GetClientCount();
    }
 
    public class RedisMemoryInfo
    {
        public long UsedMemory { get; set; }
        public string UsedMemoryHuman { get; set; } = string.Empty;
        public long MaxMemory { get; set; }
        public string MaxMemoryHuman { get; set; } = string.Empty;
        public double UsagePercent { get; set; }
    }
}