Exemple #1
0
 public MeterRecorder(IMeterMeasure meterMeasure)
 {
     this.meter = meterMeasure;
 }
        /// <summary>
        /// Starts a new processor for the given partition.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns>Task.</returns>
        public Task OpenAsync(PartitionContext context)
        {
            Logger.Information("Starting partition {Partition} processing", context.Lease.PartitionId);
            _partitionMeter = Logger.MeterOperation("partition " + context.Lease.PartitionId, "event(s)");
            _targetBlock = _pipeline.Create(context.Lease.PartitionId);
            _statLogger = new Timer(_ => _partitionMeter.Write(), null, LogInterval, LogInterval);

            return Task.FromResult(true);
        }