private Task <ExecutionResult> IoHelper(int level) { var ioWorkload = new IoWorkload(); var r = new Random(); Int64 startByte = ((long)r.Next(10, 100000000) * (long)r.Next(10, 100000000)) % (Program.cellSize * (Program.cellCount - 1L)); Int64 length = Convert.ToInt64(level) * Program.cellSize; return(ioWorkload.Run(startByte, length)); }
public async Task <JsonResult> Run(int read) { var r = new Random(); Int64 startByte = ((long)r.Next(10, 100000000) * (long)r.Next(10, 100000000)) % (Program.cellSize * (Program.cellCount - 1L)); Int64 length = read * Program.cellSize; //DateTime currentTime = System.DateTime.Now; //Guid id = Guid.NewGuid(); Console.WriteLine("IO Microsevices: is running."); var task = new IoWorkload(); ExecutionResult result = await task.Run(startByte, length); Console.WriteLine("IO Microsevices:Done."); return(new JsonResult( new { Status = "OK", IOLoad = result } )); }
public static void Main(string[] args) { Console.WriteLine(IoWorkload.GenerateRandomStringFile(cellSize * cellCount)); BuildWebHost(args).Run(); }