Exemplo n.º 1
0
        public void RecordLambdaInvokeRemote_AsPassive()
        {
            var lambdaInvokeRemote = new LambdaInvokeRemote()
            {
                Passive = true,
                Result  = Result.Succeeded,
                Runtime = Runtime.Dotnetcore31,
            };

            _telemetryLogger.Object.RecordLambdaInvokeRemote(lambdaInvokeRemote);

            Assert.NotNull(_recordedMetrics);
            _telemetryLogger.Verify(
                mock => mock.Record(_recordedMetrics),
                Times.Once
                );

            var datum = Assert.Single(_recordedMetrics.Data);

            Assert.NotNull(datum);
            Assert.Equal("lambda_invokeRemote", datum.MetricName);
            Assert.True(datum.Passive);
            Assert.Equal(lambdaInvokeRemote.Runtime.Value.ToString(), datum.Metadata["runtime"]);
            Assert.Equal(lambdaInvokeRemote.Result.ToString(), datum.Metadata["result"]);
        }
Exemplo n.º 2
0
        public void RecordLambdaInvokeRemote()
        {
            var lambdaInvokeRemote = new LambdaInvokeRemote()
            {
                AwsAccount = "abcdacbdacbd",
                AwsRegion  = "us-region-1",
                Result     = Result.Succeeded,
                Runtime    = Runtime.Dotnetcore31,
            };

            _telemetryLogger.Object.RecordLambdaInvokeRemote(lambdaInvokeRemote);

            Assert.NotNull(_recordedMetrics);
            _telemetryLogger.Verify(
                mock => mock.Record(_recordedMetrics),
                Times.Once
                );

            var datum = Assert.Single(_recordedMetrics.Data);

            Assert.NotNull(datum);
            Assert.Equal("lambda_invokeRemote", datum.MetricName);
            Assert.Equal(Unit.None, datum.Unit);
            Assert.False(datum.Passive);
            Assert.Equal(lambdaInvokeRemote.AwsAccount, datum.Metadata["awsAccount"]);
            Assert.Equal(lambdaInvokeRemote.AwsRegion, datum.Metadata["awsRegion"]);
            Assert.Equal(lambdaInvokeRemote.Runtime.Value.ToString(), datum.Metadata["runtime"]);
            Assert.Equal(lambdaInvokeRemote.Result.ToString(), datum.Metadata["result"]);
        }