private static String[] splitOnSize(final String text, final int size) {
        final String[] ret = new String[(text.length() + size - 1) / size];

        int counter = 0;
        for (int start = 0; start < text.length(); start += size) {
            ret[counter] = text.substring(start, Math.min(text.length(), start + size));
            counter++;
        }

        return ret;
    }
Extracts metrics from the provided {@link Traversal} and computes metrics. Calling this method finalizes the
metrics such that their values can no longer be modified.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java