/** * Gets a copy of the metrics that is immutable. Once this clone is made, the {@link MutableMetrics} can no * longer be modified themselves. This prevents custom steps that implement {@link Profiling} from adding to * the metrics after the traversal is complete. */ public synchronized ImmutableMetrics getImmutableClone() { finalized = true; final ImmutableMetrics clone = new ImmutableMetrics(); copyMembers(clone); this.nested.values().forEach(nested -> clone.nested.put(nested.id, ((MutableMetrics) nested).getImmutableClone())); return clone; }
@Override public MutableMetrics clone() { final MutableMetrics clone = new MutableMetrics(); copyMembers(clone); this.nested.values().forEach(nested -> clone.nested.put(nested.id, ((MutableMetrics) nested).clone())); return clone; }
/** * Gets a copy of the metrics that is immutable. Once this clone is made, the {@link MutableMetrics} can no * longer be modified themselves. This prevents custom steps that implement {@link Profiling} from adding to * the metrics after the traversal is complete. */ public synchronized ImmutableMetrics getImmutableClone() { finalized = true; final ImmutableMetrics clone = new ImmutableMetrics(); copyMembers(clone); this.nested.values().forEach(nested -> clone.nested.put(nested.id, ((MutableMetrics) nested).getImmutableClone())); return clone; }
@Override public MutableMetrics clone() { final MutableMetrics clone = new MutableMetrics(); copyMembers(clone); this.nested.values().forEach(nested -> clone.nested.put(nested.id, ((MutableMetrics) nested).clone())); return clone; }