public double executeLatency() throws Exception {
        final Client client = cluster.connect();
        final String executionId = "[" + executionName + "]";
        try {
            client.init();

            final long start = System.nanoTime();
            int size = 0;
            final Iterator itr = client.submitAsync(script).get().iterator();
            try {
                while (true) {
                    itr.next();
                    size++;
                }
            } catch (NoSuchElementException nsee) {
                ; // Expected as hasNext() not called to increase performance.
            }
            final long end = System.nanoTime();
            final long total = (end - start);

            final double totalSeconds = total / 1000000000d;
            System.out.println(String.format(StringUtils.rightPad(executionId, 10) + "time: %s, result count: %s", StringUtils.rightPad(String.valueOf(totalSeconds), 7), StringUtils.rightPad(String.valueOf(size), 10)));
            return totalSeconds;
        } catch (Exception ex) {
            if (!suppressStackTraces) ex.printStackTrace();
            throw new RuntimeException(ex);
        } finally {
            client.close();
        }
    }
An internal application used to test out configuration parameters for Gremlin Driver.

@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/util/ProfilingApplication.java