@@ -0,0 +1,1955 @@
+package org.builditbreakit.seada.logappend.io;%0D%0A%0D%0Aimport java.io.File;%0D%0Aimport java.io.IOException;%0D%0A%0D%0Aimport org.builditbreakit.seada.common.data.GalleryState;%0D%0Aimport org.builditbreakit.seada.common.data.VisitorType;%0D%0Aimport org.builditbreakit.seada.common.io.LogFileReader;%0D%0A%0D%0Apublic class IOBenchmark %7B%0D%0A%0D%0A%09public static void main(String%5B%5D args) throws InterruptedException,%0D%0A%09%09%09IOException %7B%0D%0A%09%09GalleryState state = new GalleryState();%0D%0A%09%09long time = 1;%0D%0A%09%09state.arriveAtBuilding(time++, %22Bob%22, VisitorType.EMPLOYEE);%0D%0A%09%09state.arriveAtRoom(time++, %22Bob%22, VisitorType.EMPLOYEE, 101);%0D%0A%09%09state.arriveAtBuilding(time++, %22Jill%22, VisitorType.EMPLOYEE);%0D%0A%09%09state.arriveAtBuilding(time++, %22Alice%22, VisitorType.EMPLOYEE);%0D%0A%09%09state.arriveAtRoom(time++, %22Jill%22, VisitorType.EMPLOYEE, 101);%0D%0A%09%09state.departRoom(time++, %22Bob%22, VisitorType.EMPLOYEE, 101);%0D%0A%09%09state.arriveAtBuilding(time++, %22John%22, VisitorType.GUEST);%0D%0A%09%09state.departBuilding(time++, %22John%22, VisitorType.GUEST);%0D%0A%09%09state.arriveAtBuilding(time++, %22John%22, VisitorType.GUEST);%0D%0A%09%09state.departBuilding(time++, %22John%22, VisitorType.GUEST);%0D%0A%0D%0A%09%09Thread.sleep(10000);%0D%0A%0D%0A%09%09while (true) %7B%0D%0A%09%09%09testSerialization(new GalleryState());%0D%0A%09%09%09Thread.sleep(1000);%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%09private static void testSerialization(GalleryState galleryState)%0D%0A%09%09%09throws IOException %7B%0D%0A%09%09final double millisToNanos = 1000000.0;%0D%0A%0D%0A%09%09final String password = %22secret%22;%0D%0A%0D%0A%09%09long start = System.nanoTime();%0D%0A%09%09File logFile = File.createTempFile(%22bibifi-test%22, %22tmp%22);%0D%0A%09%09logFile.deleteOnExit();%0D%0A%0D%0A%09%09LogFileWriter writer = new LogFileWriter(logFile);%0D%0A%09%09writer.write(galleryState, password);%0D%0A%0D%0A%09%09LogFileReader reader = new LogFileReader(logFile);%0D%0A%09%09reader.read(password);%0D%0A%09%09double runtime = (System.nanoTime() - start) / millisToNanos;%0D%0A%09%09long logFileSize = logFile.length();%0D%0A%0D%0A%09%09System.out.println(%22Runtime: %22 + runtime + %22 ms%22);%0D%0A%09%09System.out.println(%22Log file size: %22 + logFileSize + %22 bytes%22);%0D%0A%09%09System.out.println();%0D%0A%09%7D%0D%0A%7D%0D%0A

Add utility for testing IO performance