/// <inheritdoc /> public List <ResetHeartBeatOutput> Reset(CancellationToken cancelToken) { var results = _handler.Reset(cancelToken); foreach (var result in results) { if (result.Headers != null) { var activityContext = result.Headers.Extract(_tracer, _headers); using (var scope = _tracer.StartActivity("ResetHeartBeat", ActivityKind.Internal, activityContext, startTime: result.ApproximateResetTimeStart)) { scope?.AddMessageIdTag(result.MessageId); scope?.SetEndTime(result.ApproximateResetTimeEnd); } } else { using (var scope = _tracer.StartActivity("ResetHeartBeat", ActivityKind.Internal, null, startTime: result.ApproximateResetTimeStart)) { scope?.AddMessageIdTag(result.MessageId); scope?.SetEndTime(result.ApproximateResetTimeEnd); } } } return(results); }
/// <summary> /// Used to find and reset work items that are out of the heart beat window /// </summary> /// <param name="cancelToken">The cancel token. When set, stop processing as soon as possible</param> /// <returns></returns> public long Reset(CancellationToken cancelToken) { using (_timer.NewContext()) { var count = _handler.Reset(cancelToken); _counter.Increment(count); return(count); } }
/// <summary> /// Used to find and reset work items that are out of the heart beat window /// </summary> /// <param name="cancelToken">The cancel token. When set, stop processing as soon as possible</param> /// <returns></returns> public List <ResetHeartBeatOutput> Reset(CancellationToken cancelToken) { using (_timer.NewContext()) { var count = _handler.Reset(cancelToken); _counter.Increment(count.Count); return(count); } }
public List <ResetHeartBeatOutput> Reset(CancellationToken cancelToken) { var count = _handler.Reset(cancelToken); if (count.Count > 0) { _log.LogInformation( $"Reset the status of {count.Count} records that where outside of the heartbeat window of {_configuration.HeartBeat.Time.TotalSeconds} seconds"); } return(count); }
/// <inheritdoc /> public List <ResetHeartBeatOutput> Reset(CancellationToken cancelToken) { var results = _handler.Reset(cancelToken); foreach (var result in results) { if (result.Headers != null) { var spanContext = result.Headers.Extract(_tracer, _headers); if (spanContext != null) { IScope scope = _tracer.BuildSpan("ResetHeartBeat") .AddReference(References.FollowsFrom, spanContext).WithStartTimestamp(result.ApproximateResetTimeStart).StartActive(finishSpanOnDispose: true); scope.Span.Finish(result.ApproximateResetTimeEnd); } else { using (IScope scope = _tracer.BuildSpan("ResetHeartBeat").WithStartTimestamp(result.ApproximateResetTimeStart).StartActive(finishSpanOnDispose: true)) { scope.Span.AddMessageIdTag(result.MessageId); scope.Span.Finish(result.ApproximateResetTimeEnd); } } } else { using (IScope scope = _tracer.BuildSpan("ResetHeartBeat").WithStartTimestamp(result.ApproximateResetTimeStart).StartActive(finishSpanOnDispose: true)) { scope.Span.AddMessageIdTag(result.MessageId); scope.Span.Finish(result.ApproximateResetTimeEnd); } } } return(results); }