public void RemoveStatsCollector(StatsIdentity instance) { lock (_statsCollector) { if (_statsCollector.ContainsKey(instance)) { _statsCollector.Remove(instance); } } }
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); } }
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); }
public IStatsCollector GetStatsCollector(StatsIdentity instance) { return(_statsCollector.ContainsKey(instance) ? _statsCollector[instance] : null); }