Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BatchExportActivityProcessor"/> class with custom settings.
        /// </summary>
        /// <param name="exporter">Exporter instance.</param>
        /// <param name="maxQueueSize">The maximum queue size. After the size is reached data are dropped. The default value is 2048.</param>
        /// <param name="scheduledDelayMillis">The delay interval in milliseconds between two consecutive exports. The default value is 5000.</param>
        /// <param name="exporterTimeoutMillis">How long the export can run before it is cancelled. The default value is 30000.</param>
        /// <param name="maxExportBatchSize">The maximum batch size of every export. It must be smaller or equal to maxQueueSize. The default value is 512.</param>
        public BatchExportActivityProcessor(
            ActivityExporterSync exporter,
            int maxQueueSize          = 2048,
            int scheduledDelayMillis  = 5000,
            int exporterTimeoutMillis = 30000,
            int maxExportBatchSize    = 512)
        {
            if (maxQueueSize <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(maxQueueSize));
            }

            if (maxExportBatchSize <= 0 || maxExportBatchSize > maxQueueSize)
            {
                throw new ArgumentOutOfRangeException(nameof(maxExportBatchSize));
            }

            if (scheduledDelayMillis <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(scheduledDelayMillis));
            }

            if (exporterTimeoutMillis < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(exporterTimeoutMillis));
            }

            this.exporter           = exporter ?? throw new ArgumentNullException(nameof(exporter));
            this.maxQueueSize       = maxQueueSize;
            this.scheduledDelay     = TimeSpan.FromMilliseconds(scheduledDelayMillis);
            this.exporterTimeout    = TimeSpan.FromMilliseconds(exporterTimeoutMillis);
            this.maxExportBatchSize = maxExportBatchSize;
        }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SimpleExportActivityProcessor"/> class.
 /// </summary>
 /// <param name="exporter">Activity exporter instance.</param>
 public SimpleExportActivityProcessor(ActivityExporterSync exporter)
     : base(exporter)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SimpleExportActivityProcessor"/> class.
 /// </summary>
 /// <param name="exporter">Activity exporter instance.</param>
 public SimpleExportActivityProcessor(ActivityExporterSync exporter)
 {
     this.exporter = exporter ?? throw new ArgumentNullException(nameof(exporter));
 }