1515namespace Microsoft . Azure . WebJobs . Script . WebHost . Diagnostics
1616{
1717 public class MetricsEventManager : IDisposable
18- {
18+ {
1919 private static FunctionActivityTracker instance = null ;
2020 private readonly IEventGenerator _eventGenerator ;
2121 private readonly int _functionActivityFlushIntervalSeconds ;
@@ -31,7 +31,7 @@ public class MetricsEventManager : IDisposable
3131 public MetricsEventManager ( ScriptSettingsManager settingsManager , IEventGenerator generator , int functionActivityFlushIntervalSeconds , int metricsFlushIntervalMS = DefaultFlushIntervalMS )
3232 {
3333 // we read these in the ctor (not static ctor) since it can change on the fly
34- appName = GetNormalizedString ( settingsManager . GetSetting ( EnvironmentSettingNames . AzureWebsiteName ) ) ?? string . Empty ;
34+ appName = GetNormalizedString ( settingsManager . AzureWebsiteDefaultSubdomain ) ;
3535 subscriptionId = Utility . GetSubscriptionId ( ) ?? string . Empty ;
3636
3737 _eventGenerator = generator ;
@@ -74,7 +74,7 @@ public void EndEvent(object eventHandle)
7474 evt . Duration = DateTime . UtcNow - evt . Timestamp ;
7575 long latencyMS = ( long ) evt . Duration . TotalMilliseconds ;
7676
77- QueuedEvents . AddOrUpdate ( evt . EventName ,
77+ QueuedEvents . AddOrUpdate ( evt . EventName ,
7878 ( name ) =>
7979 {
8080 // create the default event that will be added
@@ -87,7 +87,7 @@ public void EndEvent(object eventHandle)
8787 Average = latencyMS ,
8888 Count = 1
8989 } ;
90- } ,
90+ } ,
9191 ( name , evtToUpdate ) =>
9292 {
9393 // Aggregate into the existing event
@@ -110,7 +110,7 @@ public void LogEvent(string eventName)
110110 throw new ArgumentNullException ( nameof ( eventName ) ) ;
111111 }
112112
113- QueuedEvents . AddOrUpdate ( eventName ,
113+ QueuedEvents . AddOrUpdate ( eventName ,
114114 ( name ) =>
115115 {
116116 // create the default event that will be added
@@ -120,7 +120,7 @@ public void LogEvent(string eventName)
120120 EventName = eventName . ToLowerInvariant ( ) ,
121121 Count = 1
122122 } ;
123- } ,
123+ } ,
124124 ( name , evtToUpdate ) =>
125125 {
126126 // update the existing event
@@ -180,7 +180,7 @@ internal void HostStarted(ScriptHost scriptHost)
180180 ? SerializeBindings ( function . Metadata . InputBindings )
181181 : GetNormalizedString ( null ) ,
182182 function . Metadata != null
183- ? SerializeBindings ( function . Metadata . OutputBindings )
183+ ? SerializeBindings ( function . Metadata . OutputBindings )
184184 : GetNormalizedString ( null ) ,
185185 function . Metadata . ScriptType . ToString ( ) ,
186186 function . Metadata != null ? function . Metadata . IsDisabled : false ) ;
@@ -278,7 +278,7 @@ internal FunctionActivityTracker(IEventGenerator generator, int functionActivity
278278 while ( ! _etwTaskCancellationSource . Token . IsCancellationRequested )
279279 {
280280 RaiseMetricsPerFunctionEvent ( ) ;
281-
281+
282282 if ( currentSecond >= _functionActivityFlushInterval )
283283 {
284284 RaiseFunctionMetricEvents ( ) ;
@@ -300,7 +300,7 @@ internal FunctionActivityTracker(IEventGenerator generator, int functionActivity
300300 } ,
301301 _etwTaskCancellationSource . Token ) ;
302302 }
303-
303+
304304 internal bool IsActive
305305 {
306306 get
@@ -309,12 +309,12 @@ internal bool IsActive
309309 }
310310 }
311311
312- internal IEventGenerator MetricsEventGenerator { get ; private set ; }
312+ internal IEventGenerator MetricsEventGenerator { get ; private set ; }
313313
314314 protected virtual void Dispose ( bool disposing )
315315 {
316316 if ( disposing )
317- {
317+ {
318318 _etwTaskCancellationSource . Dispose ( ) ;
319319 }
320320 }
@@ -458,7 +458,7 @@ private List<FunctionMetrics> GetMetricsQueueSnapshot()
458458 }
459459
460460 private class RunningFunctionInfo
461- {
461+ {
462462 public RunningFunctionInfo ( string name , Guid invocationId , DateTime startTime , bool success , ExecutionStage executionStage = ExecutionStage . InProgress )
463463 {
464464 Name = name ;
0 commit comments