@@ -0,0 +1,2201 @@
+package com.orbekk.stats;%0A%0Aimport java.io.FileNotFoundException;%0Aimport java.io.PrintWriter;%0Aimport java.util.ArrayList;%0Aimport java.util.HashMap;%0Aimport java.util.List;%0Aimport java.util.logging.Logger;%0A%0Aimport com.google.protobuf.RpcCallback;%0Aimport com.google.protobuf.RpcController;%0Aimport com.orbekk.stats.Experiments.Empty;%0Aimport com.orbekk.stats.Experiments.Experiment2;%0Aimport com.orbekk.stats.Experiments.SimpleTiming;%0A%0Apublic class Experiment2Impl extends Experiment2 %7B%0A    private final static Logger logger = Logger.getLogger(Experiment2Impl.class.getName());%0A    // private List%3CSimpleTiming%3E samples = new ArrayList%3CSimpleTiming%3E();%0A    %0A    private HashMap%3CInteger, List%3CDouble%3E%3E samples =%0A            new HashMap%3CInteger, List%3CDouble%3E%3E();%0A    %0A    @Override%0A    public synchronized void registerSample(RpcController controller, SimpleTiming request,%0A            RpcCallback%3CEmpty%3E done) %7B%0A        logger.info(request.toString());%0A        if (samples.get(request.getNumDevices()) == null) %7B%0A            samples.put(request.getNumDevices(), new ArrayList%3CDouble%3E());%0A        %7D%0A        samples.get(request.getNumDevices()).add(request.getTiming());%0A        done.run(Empty.getDefaultInstance());%0A    %7D%0A    %0A    public void writeSamples(String filename) %7B%0A        PrintWriter printer = null;%0A        try %7B%0A            printer = new PrintWriter(filename);%0A            System.out.println(%22Writing results to %22 + filename);%0A            printer.println(%22# Automatically generated by Experiment2Impl.java%22);%0A            %0A            printer.println(%22# %3CnumDevices%3E %3Cavg latency%3E %3Cavg-stddev%3E %3Cavg+stddev%3E%22);%0A            for (int numDevices : samples.keySet()) %7B%0A                Analysis data = new Analysis(samples.get(numDevices));%0A                double avg = data.getAverage();%0A                double stddev = data.getStandardDeviation();%0A                printer.println(String.format(%0A                        %22%25d %25f %25f %25f%22, numDevices, avg, avg-stddev, avg+stddev));%0A            %7D%0A            %0A        %7D catch (FileNotFoundException e) %7B%0A            e.printStackTrace();%0A        %7D finally %7B%0A            if (printer != null) %7B%0A                printer.close();%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Add Experiment2 server.