Ejemplo n.º 1
0
        public static WorkerResult Run(Action action, int threads, bool threadAffinity, TimeSpan duration, int?count, CancellationToken cancellationToken)
        {
            var combinedWorkerThreadResult = QueueWorkerThreads(action, threads, threadAffinity, duration, count, cancellationToken);
            var result = new WorkerResult(threads, threadAffinity, combinedWorkerThreadResult.Elapsed);

            result.Process(combinedWorkerThreadResult);
            return(result);
        }
Ejemplo n.º 2
0
 private static Task <WorkerResult> Run(Uri uri, int threads, bool threadAffinity, int pipelining, TimeSpan duration, int?count, CancellationToken cancellationToken, string requestString, string body)
 {
     return(Task.Run(() =>
     {
         var combinedWorkerThreadResult = QueueWorkerThreads(uri, threads, threadAffinity, pipelining, duration, count, cancellationToken, requestString, body);
         var workerResult = new WorkerResult(uri, threads, threadAffinity, pipelining, combinedWorkerThreadResult.Elapsed, requestString + "\r\n" + body);
         workerResult.Process(combinedWorkerThreadResult);
         return workerResult;
     }));
 }
Ejemplo n.º 3
0
 private static Task <WorkerResult> Run(Uri uri, int threads, bool threadAffinity, int pipelining, TimeSpan duration, int?count, CancellationToken cancellationToken, HttpMethod method = HttpMethod.Get, string body = null, Dictionary <string, string> headers = null)
 {
     return(Task.Run(() =>
     {
         var combinedWorkerThreadResult = QueueWorkerThreads(uri, threads, threadAffinity, pipelining, duration, count, cancellationToken, method, body, headers);
         var workerResult = new WorkerResult(uri, threads, threadAffinity, pipelining, combinedWorkerThreadResult.Elapsed);
         workerResult.Process(combinedWorkerThreadResult);
         return workerResult;
     }));
 }
Ejemplo n.º 4
0
 private Task <WorkerResult> Run(int threads, TimeSpan duration, int?count, CancellationToken cancellationToken)
 {
     return(Task.Run(() =>
     {
         var combinedWorkerThreadResult = QueueWorkerThreads(threads, duration, count, cancellationToken);
         var workerResult = new WorkerResult(threads, combinedWorkerThreadResult.Elapsed);
         workerResult.Process(combinedWorkerThreadResult);
         return workerResult;
     }));
 }