Exemple #1
0
 public void RemoveStatsCollector(StatsIdentity instance)
 {
     lock (_statsCollector)
     {
         if (_statsCollector.ContainsKey(instance))
         {
             _statsCollector.Remove(instance);
         }
     }
 }
Exemple #2
0
 public void AddStatsCollector(StatsIdentity instance, IStatsCollector statsCollector)
 {
     lock (_statsCollector)
     {
         if (_statsCollector.ContainsKey(instance))
         {
             throw new Exception("Stats Collector with the same Instance already exists");
         }
         _statsCollector.Add(instance, statsCollector);
     }
 }
Exemple #3
0
        public override bool Equals(object obj)
        {
            StatsIdentity other = obj as StatsIdentity;

            if (other == null)
            {
                return(false);
            }

            if (this.ShardName.Equals(other.ShardName) && this.DatabaseName.Equals(other.DatabaseName))
            {
                return(true);
            }

            return(false);
        }
Exemple #4
0
 public IStatsCollector GetStatsCollector(StatsIdentity instance)
 {
     return(_statsCollector.ContainsKey(instance) ? _statsCollector[instance] : null);
 }