public void setCount(final String key, final long val) {
        if (finalized) throw new IllegalStateException("Metrics have been finalized and cannot be modified");
        this.counts.put(key, new AtomicLong(val));
    }
Directly set the count for the metric.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/MutableMetrics.java