public ChannelDiagnosticsListener()

in src/Elastic.Channels/Diagnostics/ChannelDiagnosticsListener.cs [50:71]


	public ChannelDiagnosticsListener(string? name = null)
	{
		_name = name;
		ExportBufferCallback = () => Interlocked.Increment(ref _exportedBuffers);
		ExportItemsAttemptCallback = (retries, count) =>
		{
			if (retries == 0) Interlocked.Add(ref _items, count);
		};
		ExportRetryCallback = _ => Interlocked.Increment(ref _retries);
		ExportResponseCallback = (_, _) => Interlocked.Increment(ref _responses);
		ExportMaxRetriesCallback = _ => Interlocked.Increment(ref _maxRetriesExceeded);
		PublishToInboundChannelCallback = () => Interlocked.Increment(ref _inboundPublishes);
		PublishToInboundChannelFailureCallback = () => Interlocked.Increment(ref _inboundPublishFailures);
		PublishToOutboundChannelCallback = () => Interlocked.Increment(ref _outboundPublishes);
		PublishToOutboundChannelFailureCallback = () => Interlocked.Increment(ref _outboundPublishFailures);
		InboundChannelStartedCallback = () => _inboundChannelStarted = true;
		OutboundChannelStartedCallback = () => _outboundChannelStarted = true;
		OutboundChannelExitedCallback = () => _outboundChannelExited = true;

		ExportExceptionCallback = e => ObservedException ??= e;
		ExportRetryableCountCallback = i => _returnedRetryableObjects = true;
	}