Created
September 10, 2017 11:25
-
-
Save mitallast/3436c27bdbcd4e00dc816a7449f77366 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.mitallast.queue; | |
public class ProcessTest { | |
public static void main(String... args) throws Exception { | |
long start = System.currentTimeMillis(); | |
for (int i = 0; i < 1000; i++) { | |
Process vipsthumbnail = Runtime.getRuntime() | |
.exec("vipsthumbnail", new String[]{"cats.jpg", "-o", "cats.resized.vips.jpg", "--size", "x100"}); | |
vipsthumbnail.waitFor(); | |
} | |
long end = System.currentTimeMillis(); | |
printQps("vips", 1000, start, end); | |
} | |
private static void printQps(String metric, long total, long start, long end) { | |
long qps = (long) (total / (double) (end - start) * 1000.); | |
System.out.println(metric + ": " + total + " at " + (end - start) + "ms"); | |
System.out.println(metric + ": " + qps + " qps"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment