< Summary

Class:Microsoft.Azure.EventHubs.ProcessorEventSource
Assembly:Microsoft.Azure.EventHubs.Processor
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Microsoft.Azure.EventHubs.Processor\src\ProcessorEventSource.cs
Covered lines:0
Uncovered lines:101
Coverable lines:101
Total lines:337
Line coverage:0% (0 of 101)
Covered branches:0
Total branches:86
Branch coverage:0% (0 of 86)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_Log()-0%100%
.ctor()-0%100%
EventProcessorHostCreated(...)-0%0%
EventProcessorHostCloseStart(...)-0%0%
EventProcessorHostCloseStop(...)-0%0%
EventProcessorHostCloseError(...)-0%0%
EventProcessorHostOpenStart(...)-0%0%
EventProcessorHostOpenStop(...)-0%0%
EventProcessorHostOpenError(...)-0%0%
EventProcessorHostInfo(...)-0%0%
EventProcessorHostWarning(...)-0%0%
EventProcessorHostError(...)-0%0%
PartitionPumpCloseStart(...)-0%0%
PartitionPumpCloseStop(...)-0%0%
PartitionPumpCloseError(...)-0%0%
PartitionPumpCheckpointStart(...)-0%0%
PartitionPumpCheckpointStop(...)-0%0%
PartitionPumpCheckpointError(...)-0%0%
PartitionPumpCreateClientsStart(...)-0%0%
PartitionPumpCreateClientsStop(...)-0%0%
PartitionPumpInvokeProcessorOpenStart(...)-0%0%
PartitionPumpInvokeProcessorOpenStop(...)-0%0%
PartitionPumpInvokeProcessorCloseStart(...)-0%0%
PartitionPumpInvokeProcessorCloseStop(...)-0%0%
PartitionPumpInvokeProcessorEventsStart(...)-0%0%
PartitionPumpInvokeProcessorEventsStop(...)-0%0%
PartitionPumpInvokeProcessorEventsError(...)-0%0%
PartitionPumpInfo(...)-0%0%
PartitionPumpWarning(...)-0%0%
PartitionPumpError(...)-0%0%
PartitionPumpStealLeaseStart(...)-0%0%
PartitionPumpStealLeaseStop(...)-0%0%
AzureStorageManagerInfo(...)-0%0%
AzureStorageManagerWarning(...)-0%0%
AzureStorageManagerError(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Microsoft.Azure.EventHubs.Processor\src\ProcessorEventSource.cs

#LineLine coverage
 1// Copyright (c) Microsoft. All rights reserved.
 2// Licensed under the MIT license. See LICENSE file in the project root for full license information.
 3
 4namespace Microsoft.Azure.EventHubs
 5{
 6    using System;
 7    using System.Diagnostics.Tracing;
 8
 9    /// <summary>
 10    /// EventSource for Microsoft-Azure-EventHubs-Processor traces.
 11    ///
 12    /// When defining Start/Stop tasks, the StopEvent.Id must be exactly StartEvent.Id + 1.
 13    ///
 14    /// Do not explicity include the Guid here, since EventSource has a mechanism to automatically
 15    /// map to an EventSource Guid based on the Name (Microsoft-Azure-EventHubs-Processor).
 16    /// </summary>
 17    [EventSource(Name = "Microsoft-Azure-EventHubs-Processor")]
 18    internal class ProcessorEventSource : EventSource
 19    {
 020        public static ProcessorEventSource Log { get; } = new ProcessorEventSource();
 21
 022        ProcessorEventSource() { }
 23
 24        //
 25        // 1-50 reserved for EventProcessorHost traces
 26        //
 27        [Event(1, Level = EventLevel.Informational, Message = "{0}: created. EventHub: {1}.")]
 28        public void EventProcessorHostCreated(string hostId, string path)
 29        {
 030            if (IsEnabled())
 31            {
 032                WriteEvent(1, hostId, path);
 33            }
 034        }
 35
 36        [Event(2, Level = EventLevel.Informational, Message = "{0}: closing.")]
 37        public void EventProcessorHostCloseStart(string hostId)
 38        {
 039            if (IsEnabled())
 40            {
 041                WriteEvent(2, hostId);
 42            }
 043        }
 44
 45        [Event(3, Level = EventLevel.Informational, Message = "{0}: closed.")]
 46        public void EventProcessorHostCloseStop(string hostId)
 47        {
 048            if (IsEnabled())
 49            {
 050                WriteEvent(3, hostId);
 51            }
 052        }
 53
 54        [Event(4, Level = EventLevel.Error, Message = "{0}: close failed: {1}.")]
 55        public void EventProcessorHostCloseError(string hostId, string exception)
 56        {
 057            if (IsEnabled())
 58            {
 059                WriteEvent(4, hostId, exception);
 60            }
 061        }
 62
 63        [Event(5, Level = EventLevel.Informational, Message = "{0}: opening. Factory:{1}.")]
 64        public void EventProcessorHostOpenStart(string hostId, string factoryType)
 65        {
 066            if (IsEnabled())
 67            {
 068                WriteEvent(5, hostId, factoryType ?? string.Empty);
 69            }
 070        }
 71
 72        [Event(6, Level = EventLevel.Informational, Message = "{0}: opened.")]
 73        public void EventProcessorHostOpenStop(string hostId)
 74        {
 075            if (IsEnabled())
 76            {
 077                WriteEvent(6, hostId);
 78            }
 079        }
 80
 81        [Event(7, Level = EventLevel.Error, Message = "{0}: open failed: {1}.")]
 82        public void EventProcessorHostOpenError(string hostId, string exception)
 83        {
 084            if (IsEnabled())
 85            {
 086                WriteEvent(7, hostId, exception);
 87            }
 088        }
 89
 90        [Event(8, Level = EventLevel.Informational, Message = "{0}: {1}")]
 91        public void EventProcessorHostInfo(string hostId, string details)
 92        {
 093            if (IsEnabled())
 94            {
 095                WriteEvent(8, hostId, details);
 96            }
 097        }
 98
 99        [Event(9, Level = EventLevel.Warning, Message = "{0}: Warning: {1}. {2}")]
 100        public void EventProcessorHostWarning(string hostId, string details, string exception)
 101        {
 0102            if (IsEnabled())
 103            {
 0104                WriteEvent(9, hostId, details, exception ?? string.Empty);
 105            }
 0106        }
 107
 108        [Event(10, Level = EventLevel.Error, Message = "{0}: Error: {1}. {2}")]
 109        public void EventProcessorHostError(string hostId, string details, string exception)
 110        {
 0111            if (IsEnabled())
 112            {
 0113                WriteEvent(10, hostId, details, exception ?? string.Empty);
 114            }
 0115        }
 116
 117        //
 118        // 51-100 reserved for PartitionPump traces
 119        //
 120        [Event(51, Level = EventLevel.Informational, Message = "{0}: Partition {1}: Pump closing. Reason:{2}.")]
 121        public void PartitionPumpCloseStart(string hostId, string partitionId, string reason)
 122        {
 0123            if (IsEnabled())
 124            {
 0125                WriteEvent(51, hostId, partitionId, reason);
 126            }
 0127        }
 128
 129        [Event(52, Level = EventLevel.Informational, Message = "{0}: Partition {1}: Pump closed.")]
 130        public void PartitionPumpCloseStop(string hostId, string partitionId)
 131        {
 0132            if (IsEnabled())
 133            {
 0134                WriteEvent(52, hostId, partitionId);
 135            }
 0136        }
 137
 138        [Event(53, Level = EventLevel.Error, Message = "{0}: Partition {1}: Pump close error: {2}.")]
 139        public void PartitionPumpCloseError(string hostId, string partitionId, string exception)
 140        {
 0141            if (IsEnabled())
 142            {
 0143                WriteEvent(53, hostId, partitionId, exception ?? string.Empty);
 144            }
 0145        }
 146
 147        [Event(54, Level = EventLevel.Informational, Message = "{0}: Partition {1}: Saving checkpoint at Offset:{2}/Sequ
 148        public void PartitionPumpCheckpointStart(string hostId, string partitionId, string offset, long sequenceNumber)
 149        {
 0150            if (IsEnabled())
 151            {
 0152                WriteEvent(54, hostId, partitionId, offset ?? string.Empty, sequenceNumber);
 153            }
 0154        }
 155
 156        [Event(55, Level = EventLevel.Informational, Message = "{0}: Partition {1}: Done saving checkpoint.")]
 157        public void PartitionPumpCheckpointStop(string hostId, string partitionId)
 158        {
 0159            if (IsEnabled())
 160            {
 0161                WriteEvent(55, hostId, partitionId);
 162            }
 0163        }
 164
 165        [Event(56, Level = EventLevel.Error, Message = "{0}: Partition {1}: Error saving checkpoint: {2}.")]
 166        public void PartitionPumpCheckpointError(string hostId, string partitionId, string exception)
 167        {
 0168            if (IsEnabled())
 169            {
 0170                WriteEvent(56, hostId, partitionId, exception ?? string.Empty);
 171            }
 0172        }
 173
 174        [Event(57, Level = EventLevel.Informational, Message = "{0}: Partition {1}: Creating EventHubClient and Partitio
 175        public void PartitionPumpCreateClientsStart(string hostId, string partitionId, long epoch, string startAt)
 176        {
 0177            if (IsEnabled())
 178            {
 0179                WriteEvent(57, hostId, partitionId, epoch, startAt ?? string.Empty);
 180            }
 0181        }
 182
 183        [Event(58, Level = EventLevel.Informational, Message = "{0}: Partition {1}: Done creating EventHubClient and Par
 184        public void PartitionPumpCreateClientsStop(string hostId, string partitionId)
 185        {
 0186            if (IsEnabled())
 187            {
 0188                WriteEvent(58, hostId, partitionId);
 189            }
 0190        }
 191
 192        [Event(59, Level = EventLevel.Informational, Message = "{0}: Partition {1}: IEventProcessor opening. Type: {2}."
 193        public void PartitionPumpInvokeProcessorOpenStart(string hostId, string partitionId, string processorType)
 194        {
 0195            if (IsEnabled())
 196            {
 0197                WriteEvent(59, hostId, partitionId, processorType);
 198            }
 0199        }
 200
 201        [Event(60, Level = EventLevel.Informational, Message = "{0}: Partition {1}: IEventProcessor opened.")]
 202        public void PartitionPumpInvokeProcessorOpenStop(string hostId, string partitionId)
 203        {
 0204            if (IsEnabled())
 205            {
 0206                WriteEvent(60, hostId, partitionId);
 207            }
 0208        }
 209
 210        [Event(61, Level = EventLevel.Informational, Message = "{0}: Partition {1}: IEventProcessor closing. Reason: {2}
 211        public void PartitionPumpInvokeProcessorCloseStart(string hostId, string partitionId, string reason)
 212        {
 0213            if (IsEnabled())
 214            {
 0215                WriteEvent(61, hostId, partitionId, reason);
 216            }
 0217        }
 218
 219        [Event(62, Level = EventLevel.Informational, Message = "{0}: Partition {1}: IEventProcessor closed.")]
 220        public void PartitionPumpInvokeProcessorCloseStop(string hostId, string partitionId)
 221        {
 0222            if (IsEnabled())
 223            {
 0224                WriteEvent(62, hostId, partitionId);
 225            }
 0226        }
 227
 228        [Event(63, Level = EventLevel.Informational, Message = "{0}: Partition {1}: Invoking IEventProcessor.ProcessEven
 229        public void PartitionPumpInvokeProcessorEventsStart(string hostId, string partitionId, int eventCount)
 230        {
 0231            if (IsEnabled())
 232            {
 0233                WriteEvent(63, hostId, partitionId, eventCount);
 234            }
 0235        }
 236
 237        [Event(64, Level = EventLevel.Informational, Message = "{0}: Partition {1}: Done invoking IEventProcessor.Proces
 238        public void PartitionPumpInvokeProcessorEventsStop(string hostId, string partitionId)
 239        {
 0240            if (IsEnabled())
 241            {
 0242                WriteEvent(64, hostId, partitionId);
 243            }
 0244        }
 245
 246        [Event(65, Level = EventLevel.Error, Message = "{0}: Partition {1}: Error invoking IEventProcessor.ProcessEvents
 247        public void PartitionPumpInvokeProcessorEventsError(string hostId, string partitionId, string exception)
 248        {
 0249            if (IsEnabled())
 250            {
 0251                WriteEvent(65, hostId, partitionId, exception);
 252            }
 0253        }
 254
 255        [Event(66, Level = EventLevel.Informational, Message = "{0}: Partition {1}: {2}")]
 256        public void PartitionPumpInfo(string hostId, string partitionId, string details)
 257        {
 0258            if (IsEnabled())
 259            {
 0260                WriteEvent(66, hostId, partitionId, details);
 261            }
 0262        }
 263
 264        [Event(67, Level = EventLevel.Warning, Message = "{0}: Partition {1}: Warning: {2} {3}")]
 265        public void PartitionPumpWarning(string hostId, string partitionId, string details, string exception = null)
 266        {
 0267            if (IsEnabled())
 268            {
 0269                WriteEvent(67, hostId, partitionId, details, exception ?? string.Empty);
 270            }
 0271        }
 272
 273        [Event(68, Level = EventLevel.Error, Message = "{0}: Partition {1}: Error: {2} {3}")]
 274        public void PartitionPumpError(string hostId, string partitionId, string details, string exception = null)
 275        {
 0276            if (IsEnabled())
 277            {
 0278                WriteEvent(68, hostId, partitionId, details, exception ?? string.Empty);
 279            }
 0280        }
 281
 282        [Event(69, Level = EventLevel.Informational, Message = "{0}: Partition {1}: Attempting to steal lease")]
 283        public void PartitionPumpStealLeaseStart(string hostId, string partitionId)
 284        {
 0285            if (IsEnabled())
 286            {
 0287                WriteEvent(69, hostId, partitionId);
 288            }
 0289        }
 290
 291        [Event(70, Level = EventLevel.Informational, Message = "{0}: Partition {1}: Steal lease succeeded")]
 292        public void PartitionPumpStealLeaseStop(string hostId, string partitionId)
 293        {
 0294            if (IsEnabled())
 295            {
 0296                WriteEvent(70, hostId, partitionId);
 297            }
 0298        }
 299
 300        //
 301        // 101-150 reserved for AzureStorageManager traces
 302        //
 303        [Event(101, Level = EventLevel.Informational, Message = "{0}: Partition {1}: AzureStorage: {2}")]
 304        public void AzureStorageManagerInfo(string hostId, string partitionId, string details)
 305        {
 0306            if (IsEnabled())
 307            {
 0308                WriteEvent(101, hostId, partitionId, details);
 309            }
 0310        }
 311
 312        [Event(102, Level = EventLevel.Warning, Message = "{0}: Partition {1}: AzureStorage Warning: {2} {3}")]
 313        public void AzureStorageManagerWarning(string hostId, string partitionId, string details, string exception)
 314        {
 0315            if (IsEnabled())
 316            {
 0317                WriteEvent(102, hostId, partitionId, details, exception ?? string.Empty);
 318            }
 0319        }
 320
 321        [Event(103, Level = EventLevel.Error, Message = "{0}: Partition {1}: AzureStorage Error: {2} {3}")]
 322        public void AzureStorageManagerError(string hostId, string partitionId, string details, string exception)
 323        {
 0324            if (IsEnabled())
 325            {
 0326                WriteEvent(103, hostId, partitionId, details, exception);
 327            }
 0328        }
 329
 330        // TODO: Add Keywords if desired.
 331        //public class Keywords   // This is a bitvector
 332        //{
 333        //    public const EventKeywords Amqp = (EventKeywords)0x0001;
 334        //    public const EventKeywords Debug = (EventKeywords)0x0002;
 335        //}
 336    }
 337}