@@ -0,0 +1,1885 @@
+import java.io.IOException;%0Aimport java.nio.charset.Charset;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Paths;%0Aimport java.util.Comparator;%0A%0Apublic class Client %7B%0A%0A    public static void main(String%5B%5D args) throws IOException %7B%0A        Files.walk(Paths.get(%22traces%22))%0A                .filter(Files::isRegularFile)           // only consider files%0A                .filter(filePath -%3E filePath.toString().contains(%22traces_%22))    // only files that contain traces in name%0A                .sorted(Comparator.naturalOrder())      // sort file name%0A                .forEach(filePath -%3E %7B                  // for each file%0A                    System.out.println(filePath);%0A                    try %7B%0A                        Files.lines(Paths.get(filePath.toString()), Charset.forName(%22Cp1252%22))  // Open file and read lines%0A                                .map(line -%3E line.split(%22%5C%5Cs+%22)%5B1%5D)     // extract the second record from the file%0A                                .map(line -%3E Double.parseDouble(line))%0A                                .forEach(line -%3E count(line));%0A                    %7D catch (IOException e) %7B%0A                        e.printStackTrace();%0A                    %7D%0A        %7D);%0A%0A        System.out.println(%22Request time outed %22 + requestsTimeout);%0A    %7D%0A%0A    private static final long REQUESTS_SECOND = 3000;%0A    private static long time = -1;%0A    private static long requestCounter = REQUESTS_SECOND;%0A    private static long requestsTimeout = 0;%0A    %0A    public static void count(double requestTime) %7B%0A        if (time == -1) %7B%0A            time = (long)requestTime;%0A        %7D%0A%0A        if ((long)requestTime + 5 %3E= time) %7B%0A            requestCounter--;%0A        %7D%0A        else %7B%0A            requestsTimeout++;%0A        %7D%0A%0A%0A        if (requestCounter == 0 %7C%7C requestTime %3E= time + 1) %7B%0A            time++;%0A            requestCounter = REQUESTS_SECOND;%0A        %7D%0A    %7D%0A%7D%0A

Read HTTP request traces and compute number of requests that time outed.