コード例 #1
0
        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));
        }
コード例 #2
0
        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
            }
                       ));
        }
コード例 #3
0
 public static void Main(string[] args)
 {
     Console.WriteLine(IoWorkload.GenerateRandomStringFile(cellSize * cellCount));
     BuildWebHost(args).Run();
 }