Beispiel #1
0
        private static void WriteToAppendBlob(int oneKB, int blockSize, int nrBlocks, AppendBlob blobStream)
        {
            Console.WriteLine("Writing data to test2.bin./n/n");
            Console.WriteLine($"nrBlocks;blockSize;Seconds;kbits/sec");

            var t0 = DateTime.Now;

            for (int i = 0; i < nrBlocks; i++)
            {
                var bytes = GetRandomBytes(blockSize * oneKB);
                blobStream.Write(bytes, 0, bytes.Length);
            }
            var t1 = DateTime.Now;

            var delta = t1 - t0;

            Console.WriteLine($"{nrBlocks};{blockSize};{delta.TotalSeconds};{(blockSize * 8 * nrBlocks) / delta.TotalSeconds}");
        }
Beispiel #2
0
        private static void CreateFolderStructure(int oneKB, int blockSize, int nrDirectories, int nrSubFolders, int nrFilesPerDirectory)
        {
            for (var d = 0; d < nrDirectories; d++)
            {
                for (var f = 0; f < nrFilesPerDirectory; f++)
                {
                    var filename = $"Folder{d}/file{f}.bin";
                    var bStream  = new AppendBlob("testappendblobs", filename, connectionstring);
                    var oneKb    = GetRandomBytes(blockSize * oneKB);
                    bStream.Write(oneKb, 0, oneKb.Length);
                }

                for (var s = 0; s < nrSubFolders; s++)
                {
                    for (var f = 0; f < nrFilesPerDirectory; f++)
                    {
                        var filename = $"Folder{d}/Folder{d}-{s}/file{f}.bin";
                        var bStream  = new AppendBlob("testappendblobs", filename, connectionstring);
                        var oneKb    = GetRandomBytes(blockSize * oneKB);
                        bStream.Write(oneKb, 0, oneKb.Length);
                    }
                }
            }
        }