public EventsLogAnalyser(ITaskScheduler scheduler,
                                 ILogFile source,
                                 TimeSpan maximumWaitTime,
                                 EventsLogAnalyserConfiguration configuration)
        {
            if (scheduler == null)
            {
                throw new ArgumentNullException(nameof(scheduler));
            }
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            _scheduler        = scheduler;
            _source           = source;
            _buffer           = new LogLine[MaximumLineCount];
            _events           = new InMemoryLogTable();
            _indices          = new List <LogLineIndex>();
            _eventDefinitions = new List <LogEventDefinition>(configuration.Events.Count);
            _eventDefinitions.AddRange(configuration.Events.Select(TryCreateDefinition).Where(x => x != null));
            _modifications = new ConcurrentQueue <LogFileSection>();

            _source.AddListener(this, maximumWaitTime, MaximumLineCount);
            _task = _scheduler.StartPeriodic(DoWork, TimeSpan.FromMilliseconds(100));
        }
        public EventsLogAnalyserConfiguration Clone()
        {
            var clone = new EventsLogAnalyserConfiguration {
                MaxEvents = MaxEvents
            };

            clone.Events.AddRange(Events.Select(x => x.Clone()));
            return(clone);
        }