internal Stats.Node Add(string category, long bytes) { if (this.Children == null) { this.Children = Pool.Get <Dictionary <string, Stats.Node> >(); } Stats.Node orCreatePooled = this.Children.GetOrCreatePooled <string, Stats.Node>(category); orCreatePooled.Bytes += bytes; orCreatePooled.Count += (long)1; return(orCreatePooled); }
public void Flip() { if (!this.Enabled) { return; } Stats.Node building = this.Building; this.Building = this.Previous; this.Previous = building; this.Building.Clear(); }
internal void Clear() { this.Bytes = (long)0; this.Count = (long)0; if (this.Children == null) { return; } foreach (KeyValuePair <string, Stats.Node> child in this.Children) { Stats.Node value = child.Value; Pool.Free <Stats.Node>(ref value); } this.Children.Clear(); }