public RandomDownloadTest (TestReporter testReporter, CloudStorageAccount storageAccount, CloudBlobContainer container, string[] downloadTestArgs) : base(testReporter, storageAccount, container) { if (!ParseArguments(downloadTestArgs, out string blobPrefix, out ulong nBlobsToDownload, out long nBytesToDownloadPerBlob, out ulong?nBlobsAvailable, out uint?reportFrequency, out double?percentile)) { throw new ArgumentException("The provided parameters were incorrect."); } BlobPrefix = blobPrefix; NBlobsToDownload = nBlobsToDownload; if (reportFrequency != null && percentile != null) { TestProgressReporter progressReporter = new TestProgressReporter(reportFrequency.Value, percentile.Value, NBlobsToDownload); testReporter.EntryAddedEvent += progressReporter.ProcessTestEntry; } if (nBlobsAvailable != null) { NBlobsAvailable = nBlobsAvailable.Value; } else { // Determine the number of blobs that exist in the container (not interested in tracking ListBlob perf here). NBlobsAvailable = GetNumBlobsInContainer().Result; } if (NBlobsAvailable > 0) { NBytesPerBlob = GetBytesPerBlob().Result; if (nBytesToDownloadPerBlob > NBytesPerBlob) { throw new Exception($"Requested number of bytes to download per blob ({nBytesToDownloadPerBlob}) is greater than the size of blobs in container '{container.Name}' ({NBytesPerBlob})."); } NBytesPerBlob = nBytesToDownloadPerBlob; } else { throw new Exception($"No blobs exist in the specified container '{container.Name}'."); } }
public ListBlobsTest (TestReporter testReporter, CloudStorageAccount storageAccount, CloudBlobContainer container, string[] args) : base(testReporter, storageAccount, container) { if (!ParseArguments(args, out string blobPrefix, out ulong nListOperations, out uint?reportFrequency, out double?percentile)) { throw new ArgumentException("The provided parameters were incorrect."); } BlobPrefix = blobPrefix; NListOperations = nListOperations; if (reportFrequency != null && percentile != null) { TestProgressReporter progressReporter = new TestProgressReporter(reportFrequency.Value, percentile.Value, NListOperations); testReporter.EntryAddedEvent += progressReporter.ProcessTestEntry; } }
public PutBlockTest (TestReporter testReporter, CloudStorageAccount storageAccount, CloudBlobContainer container, string[] testArgs) : base(testReporter, storageAccount, container) { if (!ParseArguments(testArgs, out string blobPrefix, out ulong nBlocksToUpload, out ulong blockSizeBytes, out uint?reportFrequency, out double?percentile)) { throw new ArgumentException("The provided parameters were incorrect."); } BlobPrefix = blobPrefix; NBlocksToUpload = nBlocksToUpload; BlockSizeBytes = blockSizeBytes; if (reportFrequency != null && percentile != null) { TestProgressReporter progressReporter = new TestProgressReporter(reportFrequency.Value, percentile.Value, nBlocksToUpload); testReporter.EntryAddedEvent += progressReporter.ProcessTestEntry; } }