public FanoutMetric GetMetric(string key) { FanoutMetric metric; if (!metrics.TryGetValue(key, out metric)) { metric = new FanoutMetric(); lock (this) { listeners.Each(l => metric.AddFanout(l.Key.GetMetric(key))); } metric = metrics.AddOrUpdate(key, metric, (k, m) => metric); } return(metric); }
private static FanoutMetric AddFanout(FanoutMetric metric, long i) { metric.Add(i); return(metric); }