@Override
    public void encode(final Event event, final OutputStream out) throws IOException {
        encodeMetricIn.increment();

        encodeMetricTime.time(() -> codec.encode(event, out));
    }
@Test
    public void encodeIncrementsEventCount() throws IOException {
        codec = new AbstractCodec() {
            @Override
            public void encode(final Event event, final OutputStream out) {}
        };

        final JavaCodecDelegator codecDelegator = constructCodecDelegator();

        codecDelegator.encode(new org.logstash.Event(), new ByteArrayOutputStream());

        assertEquals(1, getMetricLongValue("encode", "writes_in"));
    }