/// <summary> /// This extension method adds a DataCollector to the Microservice. /// </summary> /// <typeparam name="P">The pipeline type.</typeparam> /// <param name="pipeline">The pipeline.</param> /// <param name="collector">The collector to add.</param> /// <returns>The pipeline.</returns> public static P AddDataCollector <P>(this P pipeline , IDataCollectorComponent collector) where P : IPipeline { pipeline.Service.DataCollection.Register(collector); return(pipeline); }
/// <summary> /// This method wraps the individual request in a safe wrapper. /// </summary> /// <param name="dataCollector">The data collector component.</param> /// <param name="eventData">The event data holder.</param> protected virtual void ProcessItem(IDataCollectorComponent dataCollector, EventHolder eventData) { try { dataCollector.Write(eventData); } catch (Exception ex) { //We don't want unexpected exceptions here and to stop the other loggers working. StatisticsInternal.ErrorIncrement(); StatisticsInternal.Ex = ex; } }
/// <summary> /// Adds the specified data collector to the collection. /// </summary> /// <param name="component">The data collector component.</param> /// <returns>Returns the component.</returns> public IDataCollectorComponent Add(IDataCollectorComponent component) { mCollectors.Add(component); return(component); }
//Data Collector #region Register(IDataCollectorComponent collector) /// <summary> /// This method is used to register a collector. /// </summary> /// <param name="collector">The collector component.</param> /// <returns>Returns the collector passed through the registration.</returns> public IDataCollectorComponent Register(IDataCollectorComponent collector) { ValidateServiceNotStarted(); mDataCollection.Add(collector); return(collector); }