Example #1
0
        private void TracingAfter(Guid operationId, string topic, string values, DateTimeOffset startTime, TimeSpan du)
        {
            var eventData = new BrokerConsumeEndEventData(
                operationId,
                "",
                _serverAddress,
                topic,
                values,
                startTime,
                du);

            s_diagnosticListener.WriteConsumeAfter(eventData);
        }
Example #2
0
        public void WriteConsumeAfterTest()
        {
            Guid operationId = Guid.NewGuid();

            DiagnosticsWapper(() =>
            {
                var eventData = new BrokerConsumeEndEventData(operationId, "", "", "", "", DateTimeOffset.UtcNow, TimeSpan.FromMinutes(1));
                s_diagnosticListener.WriteConsumeAfter(eventData);
            }, kvp =>
            {
                if (kvp.Key.Equals(CapDiagnosticListenerExtensions.CapAfterConsume))
                {
                    Assert.NotNull(kvp.Value);
                    Assert.IsType <BrokerConsumeEndEventData>(kvp.Value);
                    Assert.Equal(operationId, ((BrokerConsumeEndEventData)kvp.Value).OperationId);
                    Assert.Equal(TimeSpan.FromMinutes(1), ((BrokerConsumeEndEventData)kvp.Value).Duration);
                }
            });
        }