コード例 #1
0
ファイル: TextWriterSink.cs プロジェクト: aled/Wibblr.Metrics
 public void Flush(IEnumerable <TimestampedEvent> events)
 {
     if (events.Any())
     {
         _serializer.WriteEventHeader(_writer);
         _serializer.Write(events, _writer);
     }
 }
コード例 #2
0
 public void Flush(IEnumerable <TimestampedEvent> events)
 {
     if (events.Any())
     {
         foreach (var partition in events.Partition((a, b) => !_fileNamingStrategy.EqualNames(a, b)))
         {
             var fileName = _fileNamingStrategy.BaseName(partition.First()) + "." + _serializer.FileExtension;
             using (var w = CreateOrOpen(fileName, writer => _serializer.WriteEventHeader(writer)))
                 _serializer.Write(partition, w);
         }
     }
 }