コード例 #1
0
        /// <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);
        }
コード例 #2
0
 /// <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;
     }
 }
コード例 #3
0
 /// <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);
 }
コード例 #4
0
 //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);
 }