Exemple #1
0
        public void PublishFunctionActivity_SendsRequestHeaders()
        {
            _metricsPublisher.Initialize();
            _metricsPublisher.AddFunctionExecutionActivity(
                _testFunctionActivity.FunctionName,
                _testFunctionActivity.InvocationId,
                _testFunctionActivity.Concurrency,
                _testFunctionActivity.ExecutionStage,
                _testFunctionActivity.IsSucceeded,
                _testFunctionActivity.ExecutionTimeSpanInMs,
                _testFunctionActivity.EventTimeStamp);

            Assert.Matches("Added function activity", _testLoggerProvider.GetAllLogMessages().Single().FormattedMessage);
            Assert.Equal(LogLevel.Debug, _testLoggerProvider.GetAllLogMessages().Single().Level);

            _testLoggerProvider.ClearAllLogMessages();

            _metricsPublisher.OnFunctionMetricsPublishTimer(null);
            _metricsPublisher.OnFunctionMetricsPublishTimer(null);
            Assert.Empty(_testLoggerProvider.GetAllLogMessages());
        }
        public void PublishFunctionActivity_SendsRequestHeaders()
        {
            _metricsPublisher.Initialize();
            _metricsPublisher.AddFunctionExecutionActivity(
                _testFunctionActivity.FunctionName,
                _testFunctionActivity.InvocationId,
                _testFunctionActivity.Concurrency,
                _testFunctionActivity.ExecutionStage.ToString(),
                _testFunctionActivity.IsSucceeded,
                _testFunctionActivity.ExecutionTimeSpanInMs,
                _testFunctionActivity.ExecutionId,
                _testFunctionActivity.EventTimeStamp,
                _testFunctionActivity.StartTime);

            Assert.Empty(_testLoggerProvider.GetAllLogMessages());

            _testLoggerProvider.ClearAllLogMessages();

            _metricsPublisher.OnFunctionMetricsPublishTimer(null);
            _metricsPublisher.OnFunctionMetricsPublishTimer(null);
            Assert.Empty(_testLoggerProvider.GetAllLogMessages());
        }