/// <summary> /// Initializes a new instance of the <see cref="CmisSync.Lib.Queueing.SyncEventQueue"/> class. /// </summary> /// <param name="manager">Manager holding the handler.</param> public SyncEventQueue(ISyncEventManager manager) { if (manager == null) { throw new ArgumentException("manager may not be null"); } this.fullCounter = new QueuedEventsCounter(); this.categoryCounter = new QueuedCategorizedEventsCounter(); this.EventManager = manager; this.consumer = new Task(() => this.Listen(this.queue, this.EventManager, this.suspendHandle)); this.consumer.Start(); }
/// <summary> /// Initializes a new instance of the <see cref="CmisSync.Lib.Queueing.SyncEventQueue"/> class. /// </summary> /// <param name="manager">Manager holding the handler.</param> public SyncEventQueue(ISyncEventManager manager) { if (manager == null) { throw new ArgumentException("manager may not be null"); } this.fullCounter = new QueuedEventsCounter(); this.categoryCounter = new QueuedCategorizedEventsCounter(); this.EventManager = manager; this.consumer = new Task(() => this.Listen(this.queue, this.EventManager, this.suspendHandle)); this.consumer.Start(); }
public SingleStepEventQueue( ISyncEventManager manager, IEventCounter fullCounter = null, IEventCounter categoryCounter = null) { this.Manager = manager; this.fullCounter = fullCounter ?? new QueuedEventsCounter(); this.categoryCounter = categoryCounter ?? new QueuedCategorizedEventsCounter(); this.dropAllFsEventsHandler = new GenericSyncEventHandler <IFSEvent>( int.MaxValue, delegate(ISyncEvent e) { return(true); }); }
public SingleStepEventQueue( ISyncEventManager manager, IEventCounter fullCounter = null, IEventCounter categoryCounter = null) { this.Manager = manager; this.fullCounter = fullCounter ?? new QueuedEventsCounter(); this.categoryCounter = categoryCounter ?? new QueuedCategorizedEventsCounter(); this.dropAllFsEventsHandler = new GenericSyncEventHandler<IFSEvent>( int.MaxValue, delegate(ISyncEvent e) { return true; }); }
/// <summary> /// Logic to handle one file per thread. /// </summary> /// <param name="fileInfo"> Log file to process </param> private static void processLogFile(FileInfo fileInfo) { string pattern = @"^device_(.+).txt"; Regex rgx = new Regex(pattern, RegexOptions.IgnoreCase); MatchCollection matches = rgx.Matches(fileInfo.Name); if (matches.Count != 1 && matches[0].Groups.Count != 2) { return; } string deviceId = matches[0].Groups[1].Value; StreamReader eventLog = new StreamReader(fileInfo.FullName); IEventCounter eventCounter = EventCounter.Instance; eventCounter.ParseEvents(deviceId, eventLog); int faultySeqCount = eventCounter.GetEventCount(deviceId); Console.WriteLine(string.Format("File : {0} | Device ID : {1} | Fault Event Count : {2}", fileInfo.Name, deviceId, faultySeqCount)); }
public void Teardown() { mCounter = null; mAssembly = null; }
public void Setup() { mCounter = new EventCounter(); mAssembly = Assembly.GetExecutingAssembly(); }