From b96aeaaf3ec538ede7eddc8c16089b35efa7867b Mon Sep 17 00:00:00 2001 From: Sebastian Burckhardt Date: Mon, 2 Nov 2020 08:43:26 -0800 Subject: [PATCH] remove dead code, make the Azure Storage performance warnings less aggressive --- .../Faster/AzureBlobs/AzureStorageDevice.cs | 4 ++-- .../Faster/AzureBlobs/BlobEntry.cs | 2 +- .../StorageProviders/Faster/FasterStorage.cs | 15 --------------- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/DurableTask.Netherite/StorageProviders/Faster/AzureBlobs/AzureStorageDevice.cs b/src/DurableTask.Netherite/StorageProviders/Faster/AzureBlobs/AzureStorageDevice.cs index e617b49..2bf5e5b 100644 --- a/src/DurableTask.Netherite/StorageProviders/Faster/AzureBlobs/AzureStorageDevice.cs +++ b/src/DurableTask.Netherite/StorageProviders/Faster/AzureBlobs/AzureStorageDevice.cs @@ -283,7 +283,7 @@ namespace DurableTask.Netherite.Faster stopwatch.Stop(); - if (stopwatch.ElapsedMilliseconds > 1000) + if (stopwatch.ElapsedMilliseconds > 1000 + length / 1000) { this.BlobManager?.TraceHelper.FasterPerfWarning($"CloudPageBlob.WritePagesAsync took {stopwatch.ElapsedMilliseconds:f1}ms, which is excessive; target={blob.Name} length={length} destinationAddress={destinationAddress + offset}"); } @@ -362,7 +362,7 @@ namespace DurableTask.Netherite.Faster stopwatch.Stop(); this.BlobManager?.StorageTracer?.FasterStorageProgress($"finished download target={blob.Name} readLength={readLength} sourceAddress={sourceAddress} latencyMs={stopwatch.Elapsed.TotalMilliseconds:F1}"); - if (stopwatch.ElapsedMilliseconds > 1000) + if (stopwatch.ElapsedMilliseconds > 1000 + readLength / 1000) { this.BlobManager?.TraceHelper.FasterPerfWarning($"CloudPageBlob.DownloadRangeToStreamAsync took {stopwatch.ElapsedMilliseconds / 1000}s, which is excessive; target={blob.Name} readLength={readLength} sourceAddress={sourceAddress}"); } diff --git a/src/DurableTask.Netherite/StorageProviders/Faster/AzureBlobs/BlobEntry.cs b/src/DurableTask.Netherite/StorageProviders/Faster/AzureBlobs/BlobEntry.cs index 67b0e12..4bb04e4 100644 --- a/src/DurableTask.Netherite/StorageProviders/Faster/AzureBlobs/BlobEntry.cs +++ b/src/DurableTask.Netherite/StorageProviders/Faster/AzureBlobs/BlobEntry.cs @@ -97,7 +97,7 @@ namespace DurableTask.Netherite.Faster stopwatch.Stop(); this.azureStorageDevice.BlobManager?.StorageTracer?.FasterStorageProgress($"finished create page blob target={pageBlob.Name} size={size} latencyMs={stopwatch.Elapsed.TotalMilliseconds:F1}"); - if (stopwatch.ElapsedMilliseconds > 1000) + if (stopwatch.ElapsedMilliseconds > 3000) { this.azureStorageDevice.BlobManager?.TraceHelper.FasterPerfWarning($"CloudPageBlob.CreateAsync took {stopwatch.ElapsedMilliseconds / 1000}s, which is excessive; target={pageBlob.Name} size={size}"); } diff --git a/src/DurableTask.Netherite/StorageProviders/Faster/FasterStorage.cs b/src/DurableTask.Netherite/StorageProviders/Faster/FasterStorage.cs index c208547..9998eca 100644 --- a/src/DurableTask.Netherite/StorageProviders/Faster/FasterStorage.cs +++ b/src/DurableTask.Netherite/StorageProviders/Faster/FasterStorage.cs @@ -206,7 +206,6 @@ namespace DurableTask.Netherite.Faster await this.blobManager.StopAsync().ConfigureAwait(false); } - public void SubmitExternalEvents(IList evts) { this.logWorker.SubmitExternalEvents(evts); @@ -234,19 +233,5 @@ namespace DurableTask.Netherite.Faster this.storeWorker.Notify(); } } - - async Task TestStorageLatency() - { - Stopwatch stopwatch = new Stopwatch(); - var blob = this.blobManager.BlockBlobContainer.GetBlockBlobReference("test"); - var text = DateTime.UtcNow.ToString("o"); - stopwatch.Start(); - await blob.UploadTextAsync(text).ConfigureAwait(BlobManager.CONFIGURE_AWAIT_FOR_STORAGE_CALLS); - stopwatch.Stop(); - if (stopwatch.ElapsedMilliseconds > 1000) - { - this.TraceHelper.FasterPerfWarning($"CloudBlockBlob.UploadTextAsync took {stopwatch.ElapsedMilliseconds / 1000}s, which is excessive; target={blob} content={text}"); - } - } } } \ No newline at end of file