* Stats: Clean up some duplicate createRateStat calls (ticket #787 comment 2)

This commit is contained in:
zzz
2012-12-26 14:22:30 +00:00
parent 48309c0f6d
commit f4740d2639
6 changed files with 16 additions and 10 deletions

View File

@@ -54,9 +54,7 @@ class HTTPResponseOutputStream extends FilterOutputStream {
public HTTPResponseOutputStream(OutputStream raw) {
super(raw);
_context = I2PAppContext.getGlobalContext();
_context.statManager().createRateStat("i2ptunnel.httpCompressionRatio", "ratio of compressed size to decompressed size after transfer", "I2PTunnel", new long[] { 60*60*1000 });
_context.statManager().createRateStat("i2ptunnel.httpCompressed", "compressed size transferred", "I2PTunnel", new long[] { 60*60*1000 });
_context.statManager().createRateStat("i2ptunnel.httpExpanded", "size transferred after expansion", "I2PTunnel", new long[] { 60*60*1000 });
// all createRateStat in I2PTunnelHTTPClient.startRunning()
_log = _context.logManager().getLog(getClass());
_headerBuffer = _cache.acquire();
_buf1 = new byte[1];

View File

@@ -273,6 +273,10 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
*/
@Override
public void startRunning() {
// following are for HTTPResponseOutputStream
_context.statManager().createRateStat("i2ptunnel.httpCompressionRatio", "ratio of compressed size to decompressed size after transfer", "I2PTunnel", new long[] { 60*60*1000 });
_context.statManager().createRateStat("i2ptunnel.httpCompressed", "compressed size transferred", "I2PTunnel", new long[] { 60*60*1000 });
_context.statManager().createRateStat("i2ptunnel.httpExpanded", "size transferred after expansion", "I2PTunnel", new long[] { 60*60*1000 });
super.startRunning();
this.isr = new InternalSocketRunner(this);
_context.portMapper().register(PortMapper.SVC_HTTP_PROXY, getLocalPort());