コード例 #1
0
            public virtual void Add(Record record, string type = null, BinlogStats stats = null)
            {
                if (type != null)
                {
                    if (!recordsByType.TryGetValue(type, out var bucket))
                    {
                        bucket = Create(type);
                        recordsByType[type] = bucket;
                    }

                    type = stats.GetSubType(type, record.Args);
                    bucket.Add(record, type, stats);
                }
                else
                {
                    list.Add(record);
                }

                Count       += 1;
                TotalLength += record.Length;
                Largest      = Math.Max(Largest, (int)record.Length);
            }