Esempio n. 1
0
 /// <summary>
 /// Disposes the object.
 /// </summary>
 /// <param name="disposing">True if disposing.</param>
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (this.estimatorProcessor != null)
         {
             this.estimatorProcessor.Dispose();
             this.estimatorProcessor = null;
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AdaptiveSamplingTelemetryProcessor"/> class.
        /// <param name="settings">Sampling percentage estimator settings.</param>
        /// <param name="callback">Callback invoked every time sampling percentage is evaluated.</param>
        /// <param name="next">Next TelemetryProcessor in call chain.</param>
        /// </summary>
        public AdaptiveSamplingTelemetryProcessor(
            SamplingPercentageEstimatorSettings settings,
            AdaptiveSamplingPercentageEvaluatedCallback callback,
            ITelemetryProcessor next)
        {
            this.estimatorSettings  = settings;
            this.evaluationCallback = callback;

            // make estimatortelemetry processor  work after sampling was done
            this.estimatorProcessor = new SamplingPercentageEstimatorTelemetryProcessor(settings, this.SamplingPercentageChanged, next);
            this.samplingProcessor  = new SamplingTelemetryProcessor(this.estimatorProcessor);
        }
 /// <summary>
 /// Disposes the object.
 /// </summary>
 /// <param name="disposing">True if disposing.</param>
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         IDisposable estimatorProc = this.estimatorProcessor;
         if (estimatorProc != null)
         {
             estimatorProc.Dispose();
             this.estimatorProcessor = null;
         }
     }
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="AdaptiveSamplingTelemetryProcessor"/> class.
        /// <param name="settings">Sampling percentage estimator settings.</param>
        /// <param name="callback">Callback invoked every time sampling percentage is evaluated.</param>
        /// <param name="next">Next TelemetryProcessor in call chain.</param>
        /// </summary>
        public AdaptiveSamplingTelemetryProcessor(
            Channel.Implementation.SamplingPercentageEstimatorSettings settings,
            Channel.Implementation.AdaptiveSamplingPercentageEvaluatedCallback callback,
            ITelemetryProcessor next)
        {
            this.estimatorSettings  = settings;
            this.evaluationCallback = callback;

            // make estimator telemetry processor  work after sampling was done
            this.estimatorProcessor = new SamplingPercentageEstimatorTelemetryProcessor(settings, this.SamplingPercentageChanged, next);
            this.samplingProcessor  = new SamplingTelemetryProcessor(next, this.estimatorProcessor)
            {
                SamplingPercentage = this.estimatorSettings.InitialSamplingPercentage,
            };
        }