Exemple #1
0
        protected override IPerformanceLogger GetLogger()
        {
            var size1 = BytesHelper.GetHumanStringFromBytes(_file1.Length);
            var size2 = BytesHelper.GetHumanStringFromBytes(_file2.Length);

            return(FileGeneratorFactory.GetLogger($"{OperationType} - {size1} + {size2}", false));
        }
Exemple #2
0
        private static async Task GenerateFileAsync(string path, long size)
        {
            var textSize = BytesHelper.GetHumanStringFromBytes(size);

            using var logger = FileGeneratorFactory.GetLogger($"Generate file {textSize}");
            var fileCreator = FileGeneratorFactory.GetFileCreator();

            using var progressReporter = new ProgressReporter(size);
            var file = await fileCreator.GenerateFileAsync(path, size, progressReporter);

            Console.WriteLine($"\nFile generated {file.FullName}");
        }