@Override
    public boolean hasNext() {
        boolean start = super.hasNext();
        if (!this.onGraphComputer && !start) {
            final DefaultTraversalMetrics m = getTraversalMetricsFromSideEffects();
            if (!m.isFinalized()) m.setMetrics(this.getTraversal(), false);
        }
        return start;
    }
@author Bob Briody (http://bobbriody.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/ProfileSideEffectStep.java