@@ -0,0 +1,2024 @@
+package galileo.test.fs;%0A%0Aimport galileo.util.PerformanceTimer;%0A%0Aimport java.io.File;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.StandardOpenOption;%0Aimport java.util.Random;%0Aimport java.util.concurrent.FutureTask;%0A%0Apublic class DiskBenchmark %7B%0A%0A    private static final int dataSize = 250000000;%0A%0A    private byte data1%5B%5D = new byte%5BdataSize%5D;%0A    private byte data2%5B%5D = new byte%5BdataSize%5D;%0A%0A    private class RandomWorker implements Runnable %7B%0A        private byte%5B%5D target;%0A%0A        public RandomWorker(byte%5B%5D target) %7B%0A            this.target = target;%0A        %7D%0A%0A        public void run() %7B%0A            Random rand = new Random();%0A            rand.nextBytes(target);%0A        %7D%0A    %7D%0A%0A    public static void main(String%5B%5D args) throws Exception %7B%0A        DiskBenchmark db = new DiskBenchmark();%0A        db.run(args%5B0%5D);%0A    %7D%0A%0A    public DiskBenchmark() %7B%0A        System.out.println(%22Generating data...%22);%0A        Random rand = new Random();%0A        rand.nextBytes(data1);%0A        rand.nextBytes(data2);%0A    %7D%0A%0A    public void run(String fileName) throws Exception %7B%0A        byte%5B%5D dataA = data1;%0A        byte%5B%5D dataB = data2;%0A        double mb = dataSize / 1000000;%0A%0A        while (true) %7B%0A            FutureTask%3CString%3E ft = new FutureTask%3C%3E(%0A                    new RandomWorker(dataB), %22%22);%0A            ft.run();%0A%0A            System.out.println(%22Writing %22 + fileName);%0A            PerformanceTimer pt = new PerformanceTimer(%22Write%22);%0A            pt.start();%0A            Files.write(%0A                    new File(fileName).toPath(),%0A                    dataA,%0A                    StandardOpenOption.CREATE);%0A            pt.stop();%0A            double time = pt.getLastResult();%0A            double speed = mb / (time * 1e-3);%0A            System.out.println(speed);%0A%0A            if (ft.isDone() == false) %7B%0A                System.out.println(%22THREAD CANCELED!%22);%0A                ft.cancel(true);%0A            %7D%0A%0A            byte%5B%5D temp = dataA;%0A            dataA = dataB;%0A            dataB = temp;%0A        %7D%0A    %7D%0A%7D%0A

Add disk benchmark