backblaze
backblaze copied to clipboard
Transfer speeds reported by progress callback incorrect
I have a project now uploading files to B2 using both the simple .Files.UploadAsync and the chunked .Parts functions, and the progress callbacks I'm getting have some really weird-looking values in BytesPerSecond. They seem to be approximately 100 times too large. For instance, an upload of a ~25 MB file takes about 2 minutes here, and the entire time I'm getting progress updates telling me it's going at 15 MB/second, give or take. Am I doing something wrong??
I just took a peek at what's going on the code. I see it's using Stopwatch and then dividing the length of each buffer it transfers by the amount of time that has elapsed. I wonder if for short intervals, the Stopwatch is reporting values that are smaller than they should be, artificially inflating the speed? Or, perhaps the write operation is being heavily buffered?
I am running this on .NET 8.0 on Linux.