Beispiel #1
0
        public static HttpClient NewHttpClient(AvailabilityTestScope availabilityTestScope)
        {
            Validate.NotNull(availabilityTestScope, nameof(availabilityTestScope));

            var httpClient = new HttpClient();

            httpClient.SetAvailabilityTestRequestHeaders(availabilityTestScope);
            return(httpClient);
        }
Beispiel #2
0
        public static AvailabilityTestScope StartNew(string testDisplayName,
                                                     string locationDisplayName,
                                                     TelemetryConfiguration telemetryConfig,
                                                     bool flushOnDispose,
                                                     ILogger log,
                                                     object logScope)

        {
            log = AvailabilityTest.Log.CreateFallbackLogIfRequired(log);

            var testScope = new AvailabilityTestScope(testDisplayName, locationDisplayName, telemetryConfig, flushOnDispose, log, logScope);

            testScope.Start();

            return(testScope);
        }
Beispiel #3
0
        public static void SetAvailabilityTestRequestHeaders(this HttpClient httpClient, AvailabilityTestScope availabilityTestScope)
        {
            Validate.NotNull(httpClient, nameof(httpClient));
            Validate.NotNull(availabilityTestScope, nameof(availabilityTestScope));

            string testInfoDescriptor = availabilityTestScope.ActivitySpanOperationName;
            string testInvocationInstanceDescriptor = availabilityTestScope.DistributedOperationId;

            httpClient.SetAvailabilityTestRequestHeaders(testInfoDescriptor, testInvocationInstanceDescriptor);
        }