Beispiel #1
0
 /// <summary>
 /// Initializes a new <see cref="MongoDBEvent"/>
 /// </summary>
 /// <param name="source">The object that emitted the event</param>
 /// <param name="type">The type of event</param>
 /// <param name="detail">Specific details regarding this instance of the event</param>
 /// <param name="exception">The exception related to the event, if applicable</param>
 /// <param name="message">The message to which the event pertains, if applicable</param>
 /// <param name="endpoint">The name of the endpoint, if applicable</param>
 /// <param name="queue">The queue to which the event pertains, if applicable</param>
 /// <param name="topic">The topic to which the message pertains, if applicable</param>
 /// <param name="databaseName">The name of the MongoDB database, if applicable</param>
 /// <param name="collectionName">The name of the MongoDB collection, if applicable</param>
 /// <param name="indexName">The name of the MongoDB index, if applicable</param>
 public MongoDBEvent(object source, DiagnosticEventType type, string detail = null, Exception exception = null, Message message = null, EndpointName endpoint = null, QueueName queue = null, TopicName topic = null, string databaseName = null, string collectionName = null, string indexName = null)
     : base(source, type, detail, exception, message, endpoint, queue, topic)
 {
     DatabaseName   = databaseName;
     CollectionName = collectionName;
     IndexName      = indexName;
 }
Beispiel #2
0
 /// <summary>
 /// Initializes a new <see cref="MulticastEvent"/>
 /// </summary>
 /// <param name="source">The object that emitted the event</param>
 /// <param name="type">The type of event</param>
 /// <param name="detail">Specific details regarding this instance of the event</param>
 /// <param name="exception">The exception related to the event, if applicable</param>
 /// <param name="message">The message to which the event pertains, if applicable</param>
 /// <param name="endpoint">The name of the endpoint, if applicable</param>
 /// <param name="queue">The queue to which the event pertains, if applicable</param>
 /// <param name="topic">The topic to which the message pertains, if applicable</param>
 /// <param name="node">The node to which the multicast event pertains</param>
 /// <param name="host">The node to which the multicast event pertains</param>
 /// <param name="port">The node to which the multicast event pertains</param>
 public MulticastEvent(object source, DiagnosticEventType type, string detail = null, Exception exception = null, Message message = null, EndpointName endpoint = null, QueueName queue = null, TopicName topic = null, string node = null, string host = null, int?port = null)
     : base(source, type, detail, exception, message, endpoint, queue, topic)
 {
     Node = node;
     Host = host;
     Port = port;
 }
Beispiel #3
0
 /// <summary>
 /// Initializes a new <see cref="HttpEvent"/>
 /// </summary>
 /// <param name="source">The object that emitted the event</param>
 /// <param name="type">The type of event</param>
 /// <param name="detail">Specific details regarding this instance of the event</param>
 /// <param name="exception">The exception related to the event, if applicable</param>
 /// <param name="message">The message to which the event pertains, if applicable</param>
 /// <param name="endpoint">The name of the endpoint, if applicable</param>
 /// <param name="queue">The queue to which the event pertains, if applicable</param>
 /// <param name="topic">The topic to which the message pertains, if applicable</param>
 /// <param name="remote">The IP or hostname of the remote client</param>
 /// <param name="method">The HTTP method specified in the request</param>
 /// <param name="uri">The request URI</param>
 /// <param name="status">The HTTP status code in the response</param>
 public HttpEvent(object source, DiagnosticEventType type, string detail = null, Exception exception = null, Message message = null, EndpointName endpoint = null, QueueName queue = null, TopicName topic = null, string remote = null, string method = null, Uri uri = null, int?status = null)
     : base(source, type, detail, exception, message, endpoint, queue, topic)
 {
     Remote = remote;
     Method = method;
     Uri    = uri;
     Status = status;
 }
Beispiel #4
0
 /// <summary>
 /// Initializes a new <see cref="RabbitMQEvent"/>
 /// </summary>
 /// <param name="source">The object that emitted the event</param>
 /// <param name="type">The type of event</param>
 /// <param name="detail">Specific details regarding this instance of the event</param>
 /// <param name="exception">The exception related to the event, if applicable</param>
 /// <param name="message">The message to which the event pertains, if applicable</param>
 /// <param name="endpoint">The name of the endpoint, if applicable</param>
 /// <param name="queue">The queue to which the event pertains, if applicable</param>
 /// <param name="topic">The topic to which the message pertains, if applicable</param>
 /// <param name="exchange">The exchange to which the event pertains, if applicable</param>
 /// <param name="channelNumber">The channel number to which the message pertains, if applicable</param>
 /// <param name="consumerTag">The consumer tag to which the message pertains, if applicable</param>
 /// <param name="deliveryTag">The delivery tag to which the message pertains, if applicable</param>
 public RabbitMQEvent(object source, DiagnosticEventType type, string detail = null, Exception exception = null, Message message = null, EndpointName endpoint = null, QueueName queue = null, TopicName topic = null, string exchange = null, int?channelNumber = null, string consumerTag = null, ulong?deliveryTag = null)
     : base(source, type, detail, exception, message, endpoint, queue, topic)
 {
     Exchange      = exchange;
     ChannelNumber = channelNumber;
     ConsumerTag   = consumerTag;
     DeliveryTag   = deliveryTag;
 }
 /// <summary>
 /// Construct a new DiagnosticEventContext.
 /// </summary>
 /// <param name="op">Operation handle for the event.</param>
 /// <param name="type">The type of diagnostic event.</param>
 /// <param name="eventValue">The value for this event.</param>
 /// <param name="error">Any error that occured.</param>
 /// <param name="context">Additional context data.</param>
 public DiagnosticEventContext(AsyncOperationHandle op, DiagnosticEventType type, int eventValue = 0, string error = null, object context = null)
 {
     OperationHandle = op;
     Type            = type;
     EventValue      = eventValue;
     Location        = op.m_InternalOp != null && op.m_InternalOp is IGenericProviderOperation gen
         ? gen.Location
         : null;
     Error   = error;
     Context = context;
 }
Beispiel #6
0
 protected static DiagnosticEvent GenerateDiagnosticEvent(object source, DiagnosticEventType type,
                                                          Message message = null, string detail = null, QueueName queue = null, TopicName topic = null,
                                                          Exception ex    = null)
 {
     return(new DiagnosticEventBuilder(source, type)
     {
         Message = message,
         Detail = detail,
         Exception = ex,
         Queue = queue,
         Topic = topic
     }.Build());
 }
 public void AssertAtLeast(int count, DiagnosticEventType type)
 {
     AssertAtLeast <DiagnosticEvent>(count, e => e.Type == type);
 }
 public void AssertNoMoreThan(int count, DiagnosticEventType type)
 {
     AssertNoMoreThan <DiagnosticEvent>(count, e => e.Type == type);
 }
 public void AssertNone(DiagnosticEventType type)
 {
     AssertNone <DiagnosticEvent>(type);
 }
Beispiel #10
0
 public void AssertExactly(int count, DiagnosticEventType type)
 {
     AssertExactly <DiagnosticEvent>(count, e => e.Type == type);
 }
Beispiel #11
0
 /// <summary>
 /// Constructor for add/remove throughput warning
 /// </summary>
 /// <param name="type"></param>
 /// <param name="sender"></param>
 /// <param name="receiver"></param>
 public DiagnosticUpdateEventArgs(DiagnosticEventType type, string sender, string receiver)
 {
     EventType = type;
     Sender    = sender;
     Receiver  = receiver;
 }
Beispiel #12
0
 public void AssertNoMoreThan <TEvent>(int count, DiagnosticEventType type, Message message)
     where TEvent : DiagnosticEvent
 {
     AssertBetween <TEvent>(0, count, e => e.Type == type && e.Message?.Headers.MessageId == message.Headers.MessageId);
 }
Beispiel #13
0
 /// <summary>
 /// Constructor for add/remove missing participant
 /// </summary>
 /// <param name="type"></param>
 /// <param name="missingParticipant"></param>
 public DiagnosticUpdateEventArgs(DiagnosticEventType type, string missingParticipant)
 {
     EventType = type;
     Sender    = Receiver = missingParticipant;
 }
Beispiel #14
0
 public void AssertNone <TEvent>(DiagnosticEventType type)
     where TEvent : DiagnosticEvent
 {
     AssertExactly <TEvent>(0, e => e.Type == type);
 }
Beispiel #15
0
 /// <summary>
 /// Initializes a new SQL diagnostic event
 /// </summary>
 /// <param name="source">The object that emitted the event</param>
 /// <param name="type">The type of event</param>
 /// <param name="detail">Specific details regarding this instance of the event</param>
 /// <param name="exception">The exception related to the event, if applicable</param>
 /// <param name="message">The message to which the event pertains, if applicable</param>
 /// <param name="endpoint">The name of the endpoint, if applicable</param>
 /// <param name="queue">The queue to which the event pertains, if applicable</param>
 /// <param name="topic">The topic to which the message pertains, if applicable</param>
 /// <param name="connectionName">The name of the connection, if applicable</param>
 /// <param name="commandText">The query string, if applicable</param>
 public SQLEvent(object source, DiagnosticEventType type, string detail = null, Exception exception = null, Message message = null, EndpointName endpoint = null, QueueName queue = null, TopicName topic = null, string connectionName = null, string commandText = null)
     : base(source, type, detail, exception, message, endpoint, queue, topic)
 {
     ConnectionName = connectionName;
     CommandText    = commandText;
 }
Beispiel #16
0
 public void AssertAtLeast <TEvent>(int count, DiagnosticEventType type)
     where TEvent : DiagnosticEvent
 {
     AssertBetween <TEvent>(count, int.MaxValue, e => e.Type == type);
 }
 /// <summary>
 /// Constructor for add/remove throughput warning
 /// </summary>
 /// <param name="type"></param>
 /// <param name="sender"></param>
 /// <param name="receiver"></param>
 public DiagnosticUpdateEventArgs(DiagnosticEventType type, string sender, string receiver) {
     EventType = type;
     Sender = sender;
     Receiver = receiver;
 }
 /// <summary>
 /// Constructor for add/remove missing participant
 /// </summary>
 /// <param name="type"></param>
 /// <param name="missingParticipant"></param>
 public DiagnosticUpdateEventArgs(DiagnosticEventType type, string missingParticipant) {
     EventType = type;
     Sender = Receiver = missingParticipant;
 }
Beispiel #19
0
 /// <summary>
 /// Initializes a new <see cref="FilesystemEventBuilder"/>
 /// </summary>
 /// <param name="source">The object that will produce the event</param>
 /// <param name="type">The type of event</param>
 public FilesystemEventBuilder(object source, DiagnosticEventType type) : base(source, type)
 {
 }
Beispiel #20
0
 public void AssertNone(DiagnosticEventType type, Message message)
 {
     AssertExactly <DiagnosticEvent>(0, e => e.Type == type && e.Message?.Headers.MessageId == message.Headers.MessageId);
 }
        protected void GivenEventWithLevel(DiagnosticEventLevel level)
        {
            var diagnosticEventType = new DiagnosticEventType("TestDebug", level);

            Event = new DiagnosticEventBuilder(this, diagnosticEventType).Build();
        }
Beispiel #22
0
 public void AssertNoMoreThan(int count, DiagnosticEventType type, Message message)
 {
     AssertNoMoreThan <DiagnosticEvent>(count, e => e.Type == type && e.Message?.Headers.MessageId == message.Headers.MessageId);
 }
 /// <summary>
 /// Initializes a new <see cref="RabbitMQEventBuilder"/> for the specified
 /// </summary>
 /// <param name="source">The object that will produce the event</param>
 /// <param name="type">The type of event</param>
 public RabbitMQEventBuilder(object source, DiagnosticEventType type) : base(source, type)
 {
 }
Beispiel #24
0
 public void AssertExactly <TEvent>(int count, DiagnosticEventType type)
     where TEvent : DiagnosticEvent
 {
     AssertExactly <TEvent>(count, e => e.Type == type);
 }
 /// <summary>
 /// Initializes a new <see cref="DiagnosticEventBuilder"/> for the specified
 /// </summary>
 /// <param name="source">The object that will produce the event</param>
 /// <param name="type">The type of event</param>
 public MulticastEventBuilder(object source, DiagnosticEventType type) : base(source, type)
 {
 }
Beispiel #26
0
 public void AssertNoMoreThan <TEvent>(int count, DiagnosticEventType type)
     where TEvent : DiagnosticEvent
 {
     AssertBetween <TEvent>(0, count, e => e.Type == type);
 }
Beispiel #27
0
 public void AssertExactly <TEvent>(int count, DiagnosticEventType type, Message message)
     where TEvent : DiagnosticEvent
 {
     AssertExactly <TEvent>(count, e => e.Type == type && e.Message?.Headers.MessageId == message.Headers.MessageId);
 }
Beispiel #28
0
 /// <summary>
 /// Initializes a new <see cref="HttpEventBuilder"/>
 /// </summary>
 /// <param name="source">The object that will produce the event</param>
 /// <param name="type">The type of event</param>
 public HttpEventBuilder(object source, DiagnosticEventType type) : base(source, type)
 {
 }
Beispiel #29
0
 public void AssertAtLeast <TEvent>(int count, DiagnosticEventType type, Message message)
     where TEvent : DiagnosticEvent
 {
     AssertBetween <TEvent>(count, int.MaxValue, e => e.Type == type && e.Message?.Headers.MessageId == message.Headers.MessageId);
 }
Beispiel #30
0
        protected void GivenSomeEvent()
        {
            var type = new DiagnosticEventType("Test");

            Event = new DiagnosticEventBuilder(this, type).Build();
        }
 /// <summary>
 /// Initializes a new <see cref="DiagnosticEvent"/>
 /// </summary>
 /// <param name="source">The object that emitted the event</param>
 /// <param name="type">The type of event</param>
 /// <param name="detail">Specific details regarding this instance of the event</param>
 /// <param name="exception">The exception related to the event, if applicable</param>
 /// <param name="message">The message to which the event pertains, if applicable</param>
 /// <param name="endpoint">The name of the endpoint, if applicable</param>
 /// <param name="queue">The queue to which the event pertains, if applicable</param>
 /// <param name="topic">The topic to which the message pertains, if applicable</param>
 /// <param name="path">The path of the file or directory to which the event pertains</param>
 public FilesystemEvent(object source, DiagnosticEventType type, string detail = null, Exception exception = null, Message message = null, EndpointName endpoint = null, QueueName queue = null, TopicName topic = null, string path = null)
     : base(source, type, detail, exception, message, endpoint, queue, topic)
 {
     Path = path;
 }