Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 6f12752

Browse files
committed
Add RedisStats.ToDictionary()
1 parent 6093bd0 commit 6f12752

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/ServiceStack.Redis/RedisStats.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Threading;
1+
using System.Collections.Generic;
2+
using System.Threading;
23

34
namespace ServiceStack.Redis
45
{
@@ -43,5 +44,20 @@ public static long TotalObjectiveServersDown
4344
{
4445
get { return Interlocked.CompareExchange(ref RedisState.TotalObjectiveServersDown, 0, 0); }
4546
}
47+
48+
public static Dictionary<string, long> ToDictionary()
49+
{
50+
return new Dictionary<string, long>
51+
{
52+
{"TotalFailovers", TotalFailovers},
53+
{"TotalDeactivatedClients", TotalDeactivatedClients},
54+
{"TotalFailedSentinelWorkers", TotalFailedSentinelWorkers},
55+
{"TotalInvalidMasters", TotalInvalidMasters},
56+
{"TotalNoMastersFound", TotalNoMastersFound},
57+
{"TotalClientsCreated", TotalClientsCreated},
58+
{"TotalSubjectiveServersDown", TotalSubjectiveServersDown},
59+
{"TotalObjectiveServersDown", TotalObjectiveServersDown},
60+
};
61+
}
4662
}
4763
}

0 commit comments

Comments
 (0)