@Override
        public <I extends InputShim> Metrics read(final KryoShim<I, ?> kryo, final I input, final Class<Metrics> clazz) {
            final MutableMetrics m = new MutableMetrics(input.readString(), input.readString());

            m.setDuration(Math.round(input.readDouble() * 1000000), TimeUnit.NANOSECONDS);

            final Map<String,Long> counts = (Map<String,Long>) kryo.readObject(input, HashMap.class);
            for (Map.Entry<String, Long> count : counts.entrySet()) {
                m.setCount(count.getKey(), count.getValue());
            }

            final Map<String,Object> annotations = (Map<String,Object>) kryo.readObject(input, HashMap.class);
            for (Map.Entry<String, Object> count : annotations.entrySet()) {
                m.setAnnotation(count.getKey(), count.getValue());
            }

            final List<MutableMetrics> nesteds = (List<MutableMetrics>) kryo.readObject(input, ArrayList.class);
            for (MutableMetrics nested : nesteds) {
                m.addNested(nested);
            }
            return m;
        }
Serializes any {@link Path} implementation encountered to an {@link DetachedPath}.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3.java