Package se.cgbystrom.netty.http

Examples of se.cgbystrom.netty.http.BandwidthMeterHandler$CollectBandwidthStats


    }

    @Test
    public void bandwidthMeter() throws Exception {
        final String data = "Bandwidth metering!";
        final BandwidthMeterHandler meter = new BandwidthMeterHandler();

        PipelineFactory pf = new PipelineFactory(new ChunkedWriteHandler(), new SimpleResponseHandler(data));
        pf.setFirst(meter);
        startServer(pf);

        assertEquals(data, get("/bandwidth"));
        assertEquals(79, meter.getBytesSent());
        assertEquals(94, meter.getBytesReceived());

        meter.reset();
        assertEquals(0, meter.getBytesSent());
        assertEquals(0, meter.getBytesReceived());
    }
View Full Code Here

TOP

Related Classes of se.cgbystrom.netty.http.BandwidthMeterHandler$CollectBandwidthStats

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.