@@ -43,13 +43,14 @@ protected PartitionLoadBalancerEventSource() : base(EventSourceName)
4343 /// </summary>
4444 ///
4545 /// <param name="count"> Minimum partitions per event processor.</param>
46+ /// <param name="eventHubName">The name of the Event Hub that the load balancer is associated with.</param>
4647 ///
47- [ Event ( 1 , Level = EventLevel . Verbose , Message = "Expected minimum partitions per event processor '{0}'." ) ]
48- public virtual void MinimumPartitionsPerEventProcessor ( int count )
48+ [ Event ( 1 , Level = EventLevel . Verbose , Message = "Expected minimum partitions per event processor '{0}' for Event Hub '{1}' ." ) ]
49+ public virtual void MinimumPartitionsPerEventProcessor ( int count , string eventHubName )
4950 {
5051 if ( IsEnabled ( ) )
5152 {
52- WriteEvent ( 1 , count ) ;
53+ WriteEvent ( 1 , count , eventHubName ) ;
5354 }
5455 }
5556
@@ -59,14 +60,16 @@ public virtual void MinimumPartitionsPerEventProcessor(int count)
5960 ///
6061 /// <param name="identifier">A unique name used to identify the associated event processor.</param>
6162 /// <param name="count"> Current ownership count.</param>
63+ /// <param name="eventHubName">The name of the Event Hub that the load balancer is associated with.</param>
6264 ///
63- [ Event ( 2 , Level = EventLevel . Informational , Message = "Current ownership count is {0}. (Identifier: '{1}')" ) ]
65+ [ Event ( 2 , Level = EventLevel . Informational , Message = "Current ownership count is {0} for Event Hub '{2}' . (Identifier: '{1}')" ) ]
6466 public virtual void CurrentOwnershipCount ( int count ,
65- string identifier )
67+ string identifier ,
68+ string eventHubName )
6669 {
6770 if ( IsEnabled ( ) )
6871 {
69- WriteEvent ( 2 , count , identifier ?? string . Empty ) ;
72+ WriteEvent ( 2 , count , identifier ?? string . Empty , eventHubName ) ;
7073 }
7174 }
7275
@@ -75,13 +78,14 @@ public virtual void CurrentOwnershipCount(int count,
7578 /// </summary>
7679 ///
7780 /// <param name="unclaimedPartitions">List of unclaimed partitions.</param>
81+ /// <param name="eventHubName">The name of the Event Hub that the load balancer is associated with.</param>
7882 ///
79- [ Event ( 3 , Level = EventLevel . Informational , Message = "Unclaimed partitions: '{0}'." ) ]
80- public virtual void UnclaimedPartitions ( HashSet < string > unclaimedPartitions )
83+ [ Event ( 3 , Level = EventLevel . Informational , Message = "Unclaimed partitions: '{0}' for Event Hub '{1}' ." ) ]
84+ public virtual void UnclaimedPartitions ( HashSet < string > unclaimedPartitions , string eventHubName )
8185 {
8286 if ( IsEnabled ( ) )
8387 {
84- WriteEvent ( 3 , string . Join ( ", " , unclaimedPartitions ) ) ;
88+ WriteEvent ( 3 , string . Join ( ", " , unclaimedPartitions ) , eventHubName ) ;
8589 }
8690 }
8791
@@ -90,13 +94,14 @@ public virtual void UnclaimedPartitions(HashSet<string> unclaimedPartitions)
9094 /// </summary>
9195 ///
9296 /// <param name="partitionId">The identifier of the Event Hub partition whose ownership claim attempt is starting.</param>
97+ /// <param name="eventHubName">The name of the Event Hub that the load balancer is associated with.</param>
9398 ///
94- [ Event ( 4 , Level = EventLevel . Informational , Message = "Attempting to claim ownership of partition '{0}'." ) ]
95- public virtual void ClaimOwnershipStart ( string partitionId )
99+ [ Event ( 4 , Level = EventLevel . Informational , Message = "Attempting to claim ownership of partition '{0}' for Event Hub '{1}' ." ) ]
100+ public virtual void ClaimOwnershipStart ( string partitionId , string eventHubName )
96101 {
97102 if ( IsEnabled ( ) )
98103 {
99- WriteEvent ( 4 , partitionId ?? string . Empty ) ;
104+ WriteEvent ( 4 , partitionId ?? string . Empty , eventHubName ) ;
100105 }
101106 }
102107
@@ -106,14 +111,16 @@ public virtual void ClaimOwnershipStart(string partitionId)
106111 ///
107112 /// <param name="partitionId">The identifier of the Event Hub partition.</param>
108113 /// <param name="errorMessage">The message for the exception that occurred.</param>
114+ /// <param name="eventHubName">The name of the Event Hub that the load balancer is associated with.</param>
109115 ///
110- [ Event ( 5 , Level = EventLevel . Error , Message = "Failed to claim ownership of partition '{0}'. (ErrorMessage: '{1}')" ) ]
116+ [ Event ( 5 , Level = EventLevel . Error , Message = "Failed to claim ownership of partition '{0}' for Event Hub '{2}' . (ErrorMessage: '{1}')" ) ]
111117 public virtual void ClaimOwnershipError ( string partitionId ,
112- string errorMessage )
118+ string errorMessage ,
119+ string eventHubName )
113120 {
114121 if ( IsEnabled ( ) )
115122 {
116- WriteEvent ( 5 , partitionId ?? string . Empty , errorMessage ?? string . Empty ) ;
123+ WriteEvent ( 5 , partitionId ?? string . Empty , errorMessage ?? string . Empty , eventHubName ) ;
117124 }
118125 }
119126
@@ -122,13 +129,14 @@ public virtual void ClaimOwnershipError(string partitionId,
122129 /// </summary>
123130 ///
124131 /// <param name="identifier">A unique name used to identify the associated event processor.</param>
132+ /// <param name="eventHubName">The name of the Event Hub that the load balancer is associated with.</param>
125133 ///
126- [ Event ( 6 , Level = EventLevel . Informational , Message = "Load is unbalanced and this load balancer should steal a partition. (Identifier: '{0}')" ) ]
127- public virtual void ShouldStealPartition ( string identifier )
134+ [ Event ( 6 , Level = EventLevel . Informational , Message = "Load is unbalanced and this load balancer should steal a partition for Event Hub '{1}' . (Identifier: '{0}')" ) ]
135+ public virtual void ShouldStealPartition ( string identifier , string eventHubName )
128136 {
129137 if ( IsEnabled ( ) )
130138 {
131- WriteEvent ( 6 , identifier ?? string . Empty ) ;
139+ WriteEvent ( 6 , identifier ?? string . Empty , eventHubName ) ;
132140 }
133141 }
134142
@@ -139,15 +147,17 @@ public virtual void ShouldStealPartition(string identifier)
139147 /// <param name="partitionId">The identifier of the partition that was selected to be stolen.</param>
140148 /// <param name="stolenFrom">The identifier of the event processor that is being stolen from.</param>
141149 /// <param name="identifier">A unique name used to identify the associated event processor.</param>
150+ /// <param name="eventHubName">The name of the Event Hub that the load balancer is associated with.</param>
142151 ///
143- [ Event ( 7 , Level = EventLevel . Informational , Message = "No unclaimed partitions, attempting to steal partition '{0}' from event processor '{1}'. (Identifier: '{2}')" ) ]
152+ [ Event ( 7 , Level = EventLevel . Informational , Message = "No unclaimed partitions, attempting to steal partition '{0}' from event processor '{1}' for Event Hub '{3}' . (Identifier: '{2}'). " ) ]
144153 public virtual void StealPartition ( string partitionId ,
145154 string stolenFrom ,
146- string identifier )
155+ string identifier ,
156+ string eventHubName )
147157 {
148158 if ( IsEnabled ( ) )
149159 {
150- WriteEvent ( 7 , partitionId ?? string . Empty , stolenFrom ?? string . Empty , identifier ?? string . Empty ) ;
160+ WriteEvent ( 7 , partitionId ?? string . Empty , stolenFrom ?? string . Empty , identifier ?? string . Empty , eventHubName ) ;
151161 }
152162 }
153163
@@ -156,13 +166,14 @@ public virtual void StealPartition(string partitionId,
156166 /// </summary>
157167 ///
158168 /// <param name="identifier">A unique name used to identify the associated event processor.</param>
169+ /// <param name="eventHubName">The name of the Event Hub that the load balancer is associated with.</param>
159170 ///
160- [ Event ( 8 , Level = EventLevel . Verbose , Message = "Attempting to renew ownership. (Identifier: '{0}')" ) ]
161- public virtual void RenewOwnershipStart ( string identifier )
171+ [ Event ( 8 , Level = EventLevel . Verbose , Message = "Attempting to renew ownership for Event Hub '{1}' . (Identifier: '{0}')" ) ]
172+ public virtual void RenewOwnershipStart ( string identifier , string eventHubName )
162173 {
163174 if ( IsEnabled ( ) )
164175 {
165- WriteEvent ( 8 , identifier ?? string . Empty ) ;
176+ WriteEvent ( 8 , identifier ?? string . Empty , eventHubName ) ;
166177 }
167178 }
168179
@@ -172,14 +183,16 @@ public virtual void RenewOwnershipStart(string identifier)
172183 ///
173184 /// <param name="identifier">A unique name used to identify the associated event processor.</param>
174185 /// <param name="errorMessage">The message for the exception that occurred.</param>
186+ /// <param name="eventHubName">The name of the Event Hub that the load balancer is associated with.</param>
175187 ///
176- [ Event ( 9 , Level = EventLevel . Error , Message = "Failed to renew ownership. (Identifier: '{0}'; ErrorMessage: '{0 }')" ) ]
188+ [ Event ( 9 , Level = EventLevel . Error , Message = "Failed to renew ownership for Event Hub '{2}' . (Identifier: '{0}'; ErrorMessage: '{1 }')" ) ]
177189 public virtual void RenewOwnershipError ( string identifier ,
178- string errorMessage )
190+ string errorMessage ,
191+ string eventHubName )
179192 {
180193 if ( IsEnabled ( ) )
181194 {
182- WriteEvent ( 9 , identifier ?? string . Empty , errorMessage ?? string . Empty ) ;
195+ WriteEvent ( 9 , identifier ?? string . Empty , errorMessage ?? string . Empty , eventHubName ) ;
183196 }
184197 }
185198
@@ -188,13 +201,14 @@ public virtual void RenewOwnershipError(string identifier,
188201 /// </summary>
189202 ///
190203 /// <param name="identifier">A unique name used to identify the associated event processor.</param>
204+ /// <param name="eventHubName">The name of the Event Hub that the load balancer is associated with.</param>
191205 ///
192- [ Event ( 10 , Level = EventLevel . Verbose , Message = "Attempt to renew ownership has completed. (Identifier: '{0}')" ) ]
193- public virtual void RenewOwnershipComplete ( string identifier )
206+ [ Event ( 10 , Level = EventLevel . Verbose , Message = "Attempt to renew ownership has completed for Event Hub '{1}' . (Identifier: '{0}')" ) ]
207+ public virtual void RenewOwnershipComplete ( string identifier , string eventHubName )
194208 {
195209 if ( IsEnabled ( ) )
196210 {
197- WriteEvent ( 10 , identifier ?? string . Empty ) ;
211+ WriteEvent ( 10 , identifier ?? string . Empty , eventHubName ) ;
198212 }
199213 }
200214 }
0 commit comments