Ejemplo n.º 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));
        }
Ejemplo n.º 2
0
        private static async Task SortFileAsync(string path)
        {
            using var logger = FileGeneratorFactory.GetLogger($"Sort file");
            var fileSorter = FileGeneratorFactory.GetFileSorter();
            var sorted     = await fileSorter.SortFileAsync(path);

            Console.WriteLine($"Sorted file: {sorted}");
        }
Ejemplo n.º 3
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}");
        }
Ejemplo n.º 4
0
 protected virtual IPerformanceLogger GetLogger()
 {
     return(FileGeneratorFactory.GetLogger($"{OperationType}"));
 }