public default Traversal<S, TraversalMetrics> profile() {
        this.asAdmin().getGremlinLang().addStep(Symbols.profile);
        return this.asAdmin()
                .addStep(new ProfileSideEffectStep<>(this.asAdmin(), ProfileSideEffectStep.DEFAULT_METRICS_KEY))
                .addStep(new SideEffectCapStep<Object, TraversalMetrics>(this.asAdmin(), ProfileSideEffectStep.DEFAULT_METRICS_KEY));
    }
Profile the traversal.

@return the updated traversal with respective {@link ProfileSideEffectStep}.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Traversal.java