Commit af1b1ec6 authored by Savorboard's avatar Savorboard

refactor diagnostics

parent 9d0a453a
using System;
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
namespace DotNetCore.CAP.Diagnostics
{
public class BrokerConsumeEventData : BrokerEventData
{
public DateTimeOffset StartTime { get; }
public BrokerConsumeEventData(Guid operationId, string operation, string groupName,
public BrokerConsumeEventData(Guid operationId, string operation, string brokerAddress,
string brokerTopicName, string brokerTopicBody, DateTimeOffset startTime)
: base(operationId, operation, groupName, brokerTopicName, brokerTopicBody)
: base(operationId, operation, brokerAddress, brokerTopicName, brokerTopicBody)
{
StartTime = startTime;
}
public DateTimeOffset StartTime { get; }
}
}
}
\ No newline at end of file
using System;
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
namespace DotNetCore.CAP.Diagnostics
{
public class BrokerConsumeEndEventData : BrokerConsumeEventData
{
public TimeSpan Duration { get; }
public BrokerConsumeEndEventData(Guid operationId, string operation, string groupName, string brokerTopicName,
public BrokerConsumeEndEventData(Guid operationId, string operation, string brokerAddress,
string brokerTopicName,
string brokerTopicBody, DateTimeOffset startTime, TimeSpan duration)
: base(operationId, operation, groupName, brokerTopicName, brokerTopicBody, startTime)
: base(operationId, operation, brokerAddress, brokerTopicName, brokerTopicBody, startTime)
{
Duration = duration;
}
public TimeSpan Duration { get; }
}
}
}
\ No newline at end of file
using System;
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
namespace DotNetCore.CAP.Diagnostics
{
public class BrokerConsumeErrorEventData : BrokerConsumeEndEventData, IErrorEventData
{
public Exception Exception { get; }
public BrokerConsumeErrorEventData(Guid operationId, string operation, string groupName,
string brokerTopicName, string brokerTopicBody, Exception exception, DateTimeOffset startTime, TimeSpan duration)
: base(operationId, operation, groupName, brokerTopicName, brokerTopicBody, startTime, duration)
public BrokerConsumeErrorEventData(Guid operationId, string operation, string brokerAddress,
string brokerTopicName, string brokerTopicBody, Exception exception, DateTimeOffset startTime,
TimeSpan duration)
: base(operationId, operation, brokerAddress, brokerTopicName, brokerTopicBody, startTime, duration)
{
Exception = exception;
}
public Exception Exception { get; }
}
}
}
\ No newline at end of file
using System;
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
namespace DotNetCore.CAP.Diagnostics
{
public class BrokerPublishEventData : BrokerEventData
{
public DateTimeOffset StartTime { get; }
public BrokerPublishEventData(Guid operationId, string operation, string groupName,
public BrokerPublishEventData(Guid operationId, string operation, string brokerAddress,
string brokerTopicName, string brokerTopicBody, DateTimeOffset startTime)
: base(operationId, operation, groupName, brokerTopicName, brokerTopicBody)
: base(operationId, operation, brokerAddress, brokerTopicName, brokerTopicBody)
{
StartTime = startTime;
}
public DateTimeOffset StartTime { get; }
}
}
}
\ No newline at end of file
using System;
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
namespace DotNetCore.CAP.Diagnostics
{
public class BrokerPublishEndEventData : BrokerPublishEventData
{
public TimeSpan Duration { get; }
public BrokerPublishEndEventData(Guid operationId, string operation, string groupName, string brokerTopicName,
public BrokerPublishEndEventData(Guid operationId, string operation, string brokerAddress,
string brokerTopicName,
string brokerTopicBody, DateTimeOffset startTime, TimeSpan duration)
: base(operationId, operation, groupName, brokerTopicName, brokerTopicBody, startTime)
: base(operationId, operation, brokerAddress, brokerTopicName, brokerTopicBody, startTime)
{
Duration = duration;
}
public TimeSpan Duration { get; }
}
}
}
\ No newline at end of file
using System;
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
namespace DotNetCore.CAP.Diagnostics
{
public class BrokerPublishErrorEventData : BrokerPublishEndEventData, IErrorEventData
{
public Exception Exception { get; }
public BrokerPublishErrorEventData(Guid operationId, string operation, string groupName,
string brokerTopicName, string brokerTopicBody, Exception exception, DateTimeOffset startTime, TimeSpan duration)
: base(operationId, operation, groupName, brokerTopicName, brokerTopicBody, startTime, duration)
public BrokerPublishErrorEventData(Guid operationId, string operation, string brokerAddress,
string brokerTopicName, string brokerTopicBody, Exception exception, DateTimeOffset startTime,
TimeSpan duration)
: base(operationId, operation, brokerAddress, brokerTopicName, brokerTopicBody, startTime, duration)
{
Exception = exception;
}
public Exception Exception { get; }
}
}
}
\ No newline at end of file
using System;
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
namespace DotNetCore.CAP.Diagnostics
{
public class BrokerEventData : EventData
{
public string GroupName { get; set; }
public string BrokerTopicBody { get; set; }
public string BrokerTopicName { get; set; }
public BrokerEventData(Guid operationId, string operation, string groupName,
public BrokerEventData(Guid operationId, string operation, string brokerAddress,
string brokerTopicName, string brokerTopicBody)
: base(operationId, operation)
{
GroupName = groupName;
Headers = new TracingHeaders();
BrokerAddress = brokerAddress;
BrokerTopicName = brokerTopicName;
BrokerTopicBody = brokerTopicBody;
}
public TracingHeaders Headers { get; set; }
public string BrokerAddress { get; set; }
public string BrokerTopicBody { get; set; }
public string BrokerTopicName { get; set; }
}
}
}
\ No newline at end of file
using System;
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
namespace DotNetCore.CAP.Diagnostics
{
public class SubscriberInvokeEventData : EventData
{
public DateTimeOffset StartTime { get; }
public string MethodName { get; set; }
public string SubscribeName { get; set; }
public string SubscribeGroup { get; set; }
public string ParameterValues { get; set; }
public SubscriberInvokeEventData(Guid operationId,
string operation,
string methodName,
string methodName,
string subscribeName,
string subscribeGroup,
string parameterValues,
string parameterValues,
DateTimeOffset startTime)
: base(operationId, operation)
{
......@@ -29,5 +22,15 @@ namespace DotNetCore.CAP.Diagnostics
ParameterValues = parameterValues;
StartTime = startTime;
}
public DateTimeOffset StartTime { get; }
public string MethodName { get; set; }
public string SubscribeName { get; set; }
public string SubscribeGroup { get; set; }
public string ParameterValues { get; set; }
}
}
}
\ No newline at end of file
using System;
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
namespace DotNetCore.CAP.Diagnostics
{
public class SubscriberInvokeEndEventData : SubscriberInvokeEventData
{
public TimeSpan Duration { get; }
public SubscriberInvokeEndEventData(Guid operationId, string operation,
string methodName, string subscribeName, string subscribeGroup,
string parameterValues, DateTimeOffset startTime, TimeSpan duration)
......@@ -13,5 +14,7 @@ namespace DotNetCore.CAP.Diagnostics
{
Duration = duration;
}
public TimeSpan Duration { get; }
}
}
}
\ No newline at end of file
using System;
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
namespace DotNetCore.CAP.Diagnostics
{
public class SubscriberInvokeErrorEventData : SubscriberInvokeEndEventData, IErrorEventData
{
public Exception Exception { get; }
public SubscriberInvokeErrorEventData(Guid operationId, string operation, string methodName,
string subscribeName, string subscribeGroup, string parameterValues, Exception exception,
DateTimeOffset startTime, TimeSpan duration) : base(operationId, operation, methodName, subscribeName,
......@@ -13,5 +14,7 @@ namespace DotNetCore.CAP.Diagnostics
{
Exception = exception;
}
public Exception Exception { get; }
}
}
}
\ No newline at end of file
using System;
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
namespace DotNetCore.CAP.Diagnostics
{
......@@ -14,4 +17,4 @@ namespace DotNetCore.CAP.Diagnostics
public string Operation { get; set; }
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
namespace DotNetCore.CAP.Diagnostics
{
......@@ -8,4 +9,4 @@ namespace DotNetCore.CAP.Diagnostics
{
Exception Exception { get; }
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment