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); }
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; })); }
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; })); }
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; })); }