@Override
        public <O extends OutputShim> void write(final KryoShim<?, O> kryo, final O output, final Metrics object) {
            output.writeString(object.getId());
            output.writeString(object.getName());
            output.writeDouble(object.getDuration(TimeUnit.NANOSECONDS) / 1000000d);
            kryo.writeObject(output, object.getCounts());

            // annotations is a synchronized LinkedHashMap - get rid of the "synch" for serialization as gryo
            // doesn't know how to deserialize that well and LinkedHashMap should work with 3.3.x and previous
            final Map<String, Object> annotations = new LinkedHashMap<>();
            object.getAnnotations().forEach(annotations::put);
            kryo.writeObject(output, annotations);

            // kryo might have a problem with LinkedHashMap value collections. can't recreate it independently but
            // it gets fixed with standard collections for some reason.
            final List<Metrics> nested = new ArrayList<>(object.getNested());
            kryo.writeObject(output, nested);
        }
Serializes any {@link Path} implementation encountered to an {@link DetachedPath}.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3.java