public DiskPerformanceResult(DiskPerformanceStorage storage) { ReadPerSecondHistory = new List <long>(storage.ReadPerSecondHistory); WritePerSecondHistory = new List <long>(storage.WritePerSecondHistory); AverageReadLatencyPerSecondHistory = new List <double>(storage.AverageReadLatencyPerSecondHistory); AverageWriteLatencyPerSecondHistory = new List <double>(storage.AverageWriteLatencyPerSecondHistory); TotalRead = storage.TotalRead; TotalWrite = storage.TotalWrite; ReadLatency = storage.ReadLatencyHistogram.CreateHistogramData(); WriteLatency = storage.WriteLatencyHistogram.CreateHistogramData(); }
public DiskPerformanceTester(PerformanceTestRequest testRequest, Action<string> onInfo, CancellationToken taskKillToken = default(CancellationToken)) { this.testRequest = testRequest; this.onInfo = onInfo; this.taskKillToken = taskKillToken; testTimerCts = new CancellationTokenSource(); linkedCts = CancellationTokenSource.CreateLinkedTokenSource(taskKillToken, testTimerCts.Token); threads = new List<Thread>(testRequest.ThreadCount); dataStorage = new DiskPerformanceStorage(); perThreadRandom = Enumerable.Range(1, testRequest.ThreadCount) .Select(i => testRequest.RandomSeed.HasValue ? new Random(testRequest.RandomSeed.Value) : new Random()).ToList(); if (testRequest.Sequential && testRequest.OperationType == OperationType.Mix) { onInfo("Sequential test with mixed read/write mode is not supported. Changing to random access"); testRequest.Sequential = false; } }
public DiskPerformanceTester(PerformanceTestRequest testRequest, Action <string> onInfo, CancellationToken taskKillToken = default(CancellationToken)) { this.testRequest = testRequest; this.onInfo = onInfo; this.taskKillToken = taskKillToken; testTimerCts = new CancellationTokenSource(); linkedCts = CancellationTokenSource.CreateLinkedTokenSource(taskKillToken, testTimerCts.Token); threads = new List <Thread>(testRequest.ThreadCount); dataStorage = new DiskPerformanceStorage(); perThreadRandom = Enumerable.Range(1, testRequest.ThreadCount) .Select(i => testRequest.RandomSeed.HasValue ? new Random(testRequest.RandomSeed.Value) : new Random()).ToList(); if (testRequest.Sequential && testRequest.OperationType == OperationType.Mix) { onInfo("Sequential test with mixed read/write mode is not supported. Changing to random access"); testRequest.Sequential = false; } }
public DiskPerformanceResult(DiskPerformanceStorage storage) { ReadPerSecondHistory = new List<long>(storage.ReadPerSecondHistory); WritePerSecondHistory = new List<long>(storage.WritePerSecondHistory); AverageReadLatencyPerSecondHistory = new List<double>(storage.AverageReadLatencyPerSecondHistory); AverageWriteLatencyPerSecondHistory = new List<double>(storage.AverageWriteLatencyPerSecondHistory); TotalRead = storage.TotalRead; TotalWrite = storage.TotalWrite; ReadLatency = storage.ReadLatencyHistogram.CreateHistogramData(); WriteLatency = storage.WriteLatencyHistogram.CreateHistogramData(); }