Skip to content

Commit 050283d

Browse files
akurmimathewc
authored andcommitted
Remove old metric ETW event from MetricsEventManager
1 parent 9d94b39 commit 050283d

File tree

3 files changed

+0
-31
lines changed

3 files changed

+0
-31
lines changed

src/WebJobs.Script.WebHost/Diagnostics/IMetricsEventGenerator.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ namespace Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics
55
{
66
public interface IMetricsEventGenerator
77
{
8-
void RaiseFunctionsMetricEvent(string executionId, long executionTimeSpan, long executionCount, string executionStage);
9-
108
void RaiseMetricsPerFunctionEvent(string siteName, string functionName, long executionTimeInMs, long functionStartedCount, long functionCompletedCount, long functionFailedCount);
119

1210
void RaiseFunctionsInfoEvent(string siteName, string functionName, string inputBindings, string outputBindings, string scriptType, bool isDisabled);

src/WebJobs.Script.WebHost/Diagnostics/MetricsEventGenerator.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ namespace Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics
77
{
88
internal class MetricsEventGenerator : IMetricsEventGenerator
99
{
10-
public void RaiseFunctionsMetricEvent(string executionId, long executionTimeSpan, long executionCount, string executionStage)
11-
{
12-
MetricEventSource.Log.RaiseFunctionsMetricEvent(executionId, (ulong)executionTimeSpan, (ulong)executionCount, executionStage);
13-
}
14-
1510
public void RaiseMetricsPerFunctionEvent(string siteName, string functionName, long executionTimeInMs, long functionStartedCount, long functionCompletedCount, long functionFailedCount)
1611
{
1712
MetricEventSource.Log.RaiseMetricsPerFunctionEvent(siteName, functionName, (ulong)executionTimeInMs, (ulong)functionStartedCount, (ulong)functionCompletedCount, (ulong)functionFailedCount);
@@ -32,15 +27,6 @@ private sealed class MetricEventSource : EventSource
3227
{
3328
internal static readonly MetricEventSource Log = new MetricEventSource();
3429

35-
[Event(57906, Level = EventLevel.Informational, Channel = EventChannel.Operational)]
36-
public void RaiseFunctionsMetricEvent(string executionId, ulong executionTimeSpan, ulong executionCount, string executionStage)
37-
{
38-
if (IsEnabled())
39-
{
40-
WriteEvent(57906, executionId, executionTimeSpan, executionCount, executionStage);
41-
}
42-
}
43-
4430
[Event(57907, Level = EventLevel.Informational, Channel = EventChannel.Operational)]
4531
public void RaiseMetricsPerFunctionEvent(string siteName, string functionName, ulong executionTimeInMs, ulong functionStartedCount, ulong functionCompletedCount, ulong functionFailedCount)
4632
{

src/WebJobs.Script.WebHost/Diagnostics/MetricsEventManager.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ private class FunctionActivityTracker : IDisposable
109109
{
110110
private readonly string _executionId = Guid.NewGuid().ToString();
111111
private readonly object _functionMetricEventLockObject = new object();
112-
private DateTime _startTime = DateTime.UtcNow;
113112
private ulong _totalExecutionCount = 0;
114113
private int _metricEventIntervalInSeconds;
115114
private CancellationTokenSource _etwTaskCancellationSource = new CancellationTokenSource();
@@ -132,7 +131,6 @@ internal FunctionActivityTracker(IMetricsEventGenerator generator, int metricEve
132131

133132
if (currentSecond >= _metricEventIntervalInSeconds)
134133
{
135-
RaiseMetricEtwEvent(ExecutionStage.InProgress);
136134
RaiseFunctionMetricEvents();
137135
currentSecond = 0;
138136
}
@@ -225,7 +223,6 @@ internal void StopEtwTaskAndRaiseFinishedEvent()
225223
{
226224
_etwTaskCancellationSource.Cancel();
227225
RaiseMetricsPerFunctionEvent();
228-
RaiseMetricEtwEvent(ExecutionStage.Finished);
229226
}
230227

231228
private void RaiseFunctionMetricEvents()
@@ -264,18 +261,6 @@ private void RaiseFunctionMetricEvent(RunningFunctionInfo runningFunctionInfo, i
264261
runningFunctionInfo.Success);
265262
}
266263

267-
private void RaiseMetricEtwEvent(ExecutionStage executionStage)
268-
{
269-
var timeSpan = (ulong)(DateTime.UtcNow - _startTime).TotalMilliseconds;
270-
var executionCount = _totalExecutionCount;
271-
WriteFunctionsMetricEvent(_executionId, timeSpan, executionCount, executionStage.ToString());
272-
}
273-
274-
private void WriteFunctionsMetricEvent(string funcExecutionId, ulong executionTimeSpan, ulong executionCount, string executionStage)
275-
{
276-
MetricsEventGenerator.RaiseFunctionsMetricEvent(funcExecutionId, (long)executionTimeSpan, (long)executionCount, executionStage);
277-
}
278-
279264
private static string GetDictionaryKey(string name, Guid invocationId)
280265
{
281266
return string.Format("{0}_{1}", name.ToString(), invocationId.ToString());

0 commit comments

Comments
 (0)