Esempio n. 1
0
            public TransformingEventHandler(StreamTransformerSettings settings, ILog log)
            {
                this.settings = settings;
                this.log      = log;

                buffer = new List <HerculesEvent>();

                writer = new StreamWriter(
                    new StreamWriterSettings(settings.TargetStreamName, settings.GateClient)
                {
                    DelayOnError         = settings.DelayOnError,
                    EventsWriteBatchSize = settings.EventsWriteBatchSize,
                    EventsWriteTimeout   = settings.EventsWriteTimeout
                },
                    log);

                eventsMetric = settings.MetricContext?.CreateIntegerGauge("events", "type", new IntegerGaugeConfig {
                    ResetOnScrape = true
                });
                iterationMetric = settings.MetricContext?.CreateSummary("iteration", "type", new SummaryConfig {
                    Quantiles = new[] { 0.5, 0.75, 1 }
                });
            }
Esempio n. 2
0
 public StreamTransformer([NotNull] StreamTransformerSettings settings, [CanBeNull] ILog log)
 {
     this.settings = settings ?? throw new ArgumentNullException(nameof(settings));
     this.log      = (log ?? LogProvider.Get()).ForContext <StreamTransformer>();
 }