Beispiel #1
0
        /// <summary>
        /// Writes the event.
        /// </summary>
        public override void WriteEvent(Event ev)
        {
            EventTable eventTable = GetEventTable(ev.Timestamp);

            if (eventTable.AddEvent(ev))
            {
                stopwatch.Restart();
                adapter.FileName = eventTable.FileName;
                adapter.AppendEvent(ev);
                eventTable.FileAge = File.GetLastWriteTimeUtc(eventTable.FileName);

                stopwatch.Stop();
                arcLog?.WriteAction(ServerPhrases.WritingEventCompleted, stopwatch.ElapsedMilliseconds);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Writes the event.
        /// </summary>
        public override void WriteEvent(Event ev)
        {
            EventTable eventTable = GetEventTable(ev.Timestamp);

            stopwatch.Restart();
            adapter.FileName = eventTable.FileName;

            if (eventTable.AddEvent(ev))
            {
                adapter.AppendEvent(ev); // write new event
            }
            else if (ev.Ack)
            {
                adapter.WriteEventAck(ev); // update acknowledgement
            }
            eventTable.LastWriteTime = File.GetLastWriteTimeUtc(eventTable.FileName);
            stopwatch.Stop();
            arcLog?.WriteAction(ServerPhrases.WritingEventCompleted, stopwatch.ElapsedMilliseconds);
        }