Esempio n. 1
0
        public RedisMemoryAnalysis(RedisConnectionInfo connectionInfo, int database)
        {
            CreationDate = DateTime.UtcNow;
            KeyStats     = new ConcurrentDictionary <KeyMatcher, KeyStats>();

            ConnectionInfo = connectionInfo;
            Database       = database;
            if (!RedisAnalyzer.KeyMatchers.TryGetValue(connectionInfo, out var matchers))
            {
                ErrorMessage = "Could not find regexes defined for " + connectionInfo;
                return;
            }
            KeyMatchers = matchers;
            foreach (var km in matchers)
            {
                KeyStats[km] = new KeyStats();
            }
        }
Esempio n. 2
0
        public RedisMemoryAnalysis(RedisAnalyzer analyzer, RedisConnectionInfo connectionInfo, int database)
        {
            CreationDate = DateTime.UtcNow;
            KeyStats     = new ConcurrentDictionary <KeyMatcher, KeyStats>();

            ConnectionInfo = connectionInfo;
            Database       = database;
            KeyMatchers    = analyzer.KeyMatchers;
            if (KeyMatchers.Count == 0)
            {
                ErrorMessage = "Could not find regexes defined for " + connectionInfo;
                return;
            }
            foreach (var km in KeyMatchers)
            {
                KeyStats[km] = new KeyStats();
            }
        }