Commit e797a57a authored by Robert Butora's avatar Robert Butora
Browse files

adds soda exec time meas (System.nanoTime() based)

parent ffefc997
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -73,6 +73,8 @@ class ExecCmd

      LOGGER.info("CMD: " + Arrays.toString(cmd));

      long start_nsec = System.nanoTime();

      Runtime rt = Runtime.getRuntime();
      Process proc = rt.exec(cmd);

@@ -82,6 +84,8 @@ class ExecCmd
      // any output?
      StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT", outputStream);

      long meas1_nsec = System.nanoTime();

      // kick them off
      outputGobbler.start();
      errorGobbler.start();
@@ -89,9 +93,21 @@ class ExecCmd
      outputGobbler.join();
      errorGobbler.join();

      long meas2_nsec = System.nanoTime();

      exitValue = proc.waitFor();

      long meas3_nsec = System.nanoTime();

      outputStream.flush();

      long meas4_nsec = System.nanoTime();

      LOGGER.info("RUNTIME[nsec] ExecCmd::doRun(): "
            +       String.valueOf((long)Math.round( (meas1_nsec - start_nsec)/1.0e6 ))
            + " " + String.valueOf((long)Math.round( (meas2_nsec - start_nsec)/1.0e6 ))
            + " " + String.valueOf((long)Math.round( (meas3_nsec - start_nsec)/1.0e6 ))
            + " " + String.valueOf((long)Math.round( (meas4_nsec - start_nsec)/1.0e6 )));
   }


+2 −0
Original line number Diff line number Diff line
@@ -244,6 +244,7 @@ public class ServletCutout extends HttpServlet
      {
         boolean showDuration   = settings.defaults.showDuration;
         long    startTime_msec = System.currentTimeMillis();
         long    startTime_nsec = System.nanoTime();

         ServletOutputStream  respOutputStream = response.getOutputStream();

@@ -338,6 +339,7 @@ public class ServletCutout extends HttpServlet
            respOutputStream.close();
         }

         LOGGER.info("RUNTIME[nsec] Servlet::execRequest: "+String.valueOf(System.nanoTime() - startTime_nsec));
      }

   private String convertLocalPathnameToRemoteUrl(String localPathname,