public IMessageHandlerStats GetStats() { var total = new MessageHandlerStats("All Handlers"); messageHandlers.ToList().ForEach(x => total.Add(x.GetStats())); return(total); }
public static IMessageHandlerStats CombineStats(this IEnumerable <IMessageHandlerStats> stats) { IMessageHandlerStats to = null; if (stats != null) { foreach (var stat in stats) { if (to == null) { to = new MessageHandlerStats(stat.Name); } to.Add(stat); } } return(to); }