Beispiel #1
0
 public void Flush(IEnumerable <WindowedCounter> counters)
 {
     if (counters.Any())
     {
         _serializer.WriteCounterHeader(_writer);
         _serializer.Write(counters, _writer);
     }
 }
Beispiel #2
0
 public void Flush(IEnumerable <WindowedCounter> counters)
 {
     if (counters.Any())
     {
         foreach (var partition in counters.Partition((a, b) => !_fileNamingStrategy.EqualNames(a, b)))
         {
             var fileName = _fileNamingStrategy.BaseName(partition.First()) + "." + _serializer.FileExtension;
             using (var w = CreateOrOpen(fileName, writer => _serializer.WriteCounterHeader(writer)))
                 _serializer.Write(partition, w);
         }
     }
 }