private void RaiseFunctionMetricEvent(RunningFunctionInfo runningFunctionInfo, int concurrency, DateTime currentTime) { double executionTimespan = 0; if (runningFunctionInfo.ExecutionStage == ExecutionStage.Finished) { executionTimespan = (runningFunctionInfo.EndTime - runningFunctionInfo.StartTime).TotalMilliseconds; } else { executionTimespan = (currentTime - runningFunctionInfo.StartTime).TotalMilliseconds; } MetricsEventGenerator.LogFunctionExecutionEvent( _executionId, appName, concurrency, runningFunctionInfo.Name, runningFunctionInfo.InvocationId.ToString(), runningFunctionInfo.ExecutionStage.ToString(), (long)executionTimespan, runningFunctionInfo.Success); if (_metricsPublisher != null) { _metricsPublisher.AddFunctionExecutionActivity( runningFunctionInfo.Name, runningFunctionInfo.InvocationId.ToString(), concurrency, runningFunctionInfo.ExecutionStage.ToString(), runningFunctionInfo.Success, (long)executionTimespan, _executionId, currentTime, runningFunctionInfo.StartTime); } }
private void RaiseFunctionMetricEvent(RunningFunctionInfo runningFunctionInfo, int concurrency, DateTime currentTime) { double executionTimespan = 0; if (runningFunctionInfo.ExecutionStage == ExecutionStage.Finished) { executionTimespan = (runningFunctionInfo.EndTime - runningFunctionInfo.StartTime).TotalMilliseconds; } else { executionTimespan = (currentTime - runningFunctionInfo.StartTime).TotalMilliseconds; } MetricsEventGenerator.LogFunctionExecutionEvent( _executionId, appName, concurrency, runningFunctionInfo.Name, runningFunctionInfo.InvocationId.ToString(), runningFunctionInfo.ExecutionStage.ToString(), (long)executionTimespan, runningFunctionInfo.Success); }