Esempio n. 1
0
        public static async Task StartRequestSubmitterAsync(
            Uri serviceUri,
            string storageConnectionString,
            string instanceId,
            int tps,
            int totalRequests)
        {
            var testClient = new TestWebApiSubmitter(serviceUri);

            while (true)
            {
                try
                {
                    var      requestSubmissionTask = testClient.SubmitRequestsAsync(totalRequests, tps);
                    var      stopwatch             = Stopwatch.StartNew();
                    TimeSpan avgReqTime            = await requestSubmissionTask;
                    TestRecorder.RecordAvgLatency(storageConnectionString, instanceId, avgReqTime, totalRequests,
                                                  tps, stopwatch.Elapsed);
                }
                catch (Exception ex)
                {
                    TestRecorder.LogException(storageConnectionString, instanceId, ex);
                }
            }
        }
 public static async Task StartRequestSubmitterAsync(
     Uri serviceUri,
     string storageConnectionString,
     string instanceId,
     int tps,
     int totalRequests)
 {
     var testClient = new TestWebApiSubmitter(serviceUri);
     while (true)
     {
         try
         {
             var requestSubmissionTask = testClient.SubmitRequestsAsync(totalRequests, tps);
             var stopwatch = Stopwatch.StartNew();
             TimeSpan avgReqTime = await requestSubmissionTask;
             TestRecorder.RecordAvgLatency(storageConnectionString, instanceId, avgReqTime, totalRequests,
                 tps, stopwatch.Elapsed);
         }
         catch (Exception ex)
         {
             TestRecorder.LogException(storageConnectionString, instanceId, ex);
         }
     }
 }