private static RedisMemoryAnalysis GetDatabaseMemoryAnalysis(RedisConnectionInfo connectionInfo, int database) { var config = new ConfigurationOptions { SyncTimeout = 10 * 60 * 1000, AllowAdmin = true, ClientName = "Status-MemoryAnalyzer", Password = connectionInfo.Password, EndPoints = { { connectionInfo.Host, connectionInfo.Port } } }; using (var muxer = ConnectionMultiplexer.Connect(config)) { var ma = new RedisMemoryAnalysis(connectionInfo, database); if (ma.ErrorMessage.HasValue()) { return(ma); } // Prep the match dictionary foreach (var km in KeyMatchers[connectionInfo]) { ma.KeyStats[km] = new KeyStats(); } ma.Analyze(muxer); return(ma); } }
private static RedisMemoryAnalysis GetDatabaseMemoryAnalysis(RedisConnectionInfo connectionInfo, int database) { using (var rc = new RedisConnection(connectionInfo.Host, connectionInfo.Port, syncTimeout: 10 * 60 * 1000, allowAdmin: true)) { var ma = new RedisMemoryAnalysis(connectionInfo, database); if (ma.ErrorMessage.HasValue()) { return(ma); } // Prep the match dictionary foreach (var km in KeyMatchers[connectionInfo]) { ma.KeyStats[km] = new KeyStats(); } rc.Name = "Status-MemoryAnalyzer"; rc.Wait(rc.Open()); ma.Analyze(rc); return(ma); } }