* 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) { public HTTPResponseOutputStream(OutputStream raw) {
super(raw); super(raw);
_context = I2PAppContext.getGlobalContext(); _context = I2PAppContext.getGlobalContext();
_context.statManager().createRateStat("i2ptunnel.httpCompressionRatio", "ratio of compressed size to decompressed size after transfer", "I2PTunnel", new long[] { 60*60*1000 }); // all createRateStat in I2PTunnelHTTPClient.startRunning()
_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 });
_log = _context.logManager().getLog(getClass()); _log = _context.logManager().getLog(getClass());
_headerBuffer = _cache.acquire(); _headerBuffer = _cache.acquire();
_buf1 = new byte[1]; _buf1 = new byte[1];

View File

@@ -273,6 +273,10 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
*/ */
@Override @Override
public void startRunning() { 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(); super.startRunning();
this.isr = new InternalSocketRunner(this); this.isr = new InternalSocketRunner(this);
_context.portMapper().register(PortMapper.SVC_HTTP_PROXY, getLocalPort()); _context.portMapper().register(PortMapper.SVC_HTTP_PROXY, getLocalPort());

View File

@@ -132,6 +132,12 @@ public class JobQueue {
"How many jobs do we drop due to insane overload?", "How many jobs do we drop due to insane overload?",
"JobQueue", "JobQueue",
new long[] { 60*1000l, 60*60*1000l, 24*60*60*1000l }); new long[] { 60*1000l, 60*60*1000l, 24*60*60*1000l });
// following are for JobQueue
_context.statManager().createRateStat("jobQueue.jobRun", "How long jobs take", "JobQueue", new long[] { 60*60*1000l, 24*60*60*1000l });
_context.statManager().createRateStat("jobQueue.jobRunSlow", "How long jobs that take over a second take", "JobQueue", new long[] { 60*60*1000l, 24*60*60*1000l });
_context.statManager().createRequiredRateStat("jobQueue.jobLag", "Job run delay (ms)", "JobQueue", new long[] { 60*1000l, 60*60*1000l, 24*60*60*1000l });
_context.statManager().createRateStat("jobQueue.jobWait", "How long does a job sit on the job queue?", "JobQueue", new long[] { 60*60*1000l, 24*60*60*1000l });
//_context.statManager().createRateStat("jobQueue.jobRunnerInactive", "How long are runners inactive?", "JobQueue", new long[] { 60*1000l, 60*60*1000l, 24*60*60*1000l });
_alive = true; _alive = true;
_readyJobs = new LinkedBlockingQueue(); _readyJobs = new LinkedBlockingQueue();

View File

@@ -19,11 +19,7 @@ class JobQueueRunner implements Runnable {
_id = id; _id = id;
_keepRunning = true; _keepRunning = true;
_log = _context.logManager().getLog(JobQueueRunner.class); _log = _context.logManager().getLog(JobQueueRunner.class);
_context.statManager().createRateStat("jobQueue.jobRun", "How long jobs take", "JobQueue", new long[] { 60*60*1000l, 24*60*60*1000l }); // all createRateStat in JobQueue
_context.statManager().createRateStat("jobQueue.jobRunSlow", "How long jobs that take over a second take", "JobQueue", new long[] { 60*60*1000l, 24*60*60*1000l });
_context.statManager().createRequiredRateStat("jobQueue.jobLag", "Job run delay (ms)", "JobQueue", new long[] { 60*1000l, 60*60*1000l, 24*60*60*1000l });
_context.statManager().createRateStat("jobQueue.jobWait", "How long does a job sit on the job queue?", "JobQueue", new long[] { 60*60*1000l, 24*60*60*1000l });
//_context.statManager().createRateStat("jobQueue.jobRunnerInactive", "How long are runners inactive?", "JobQueue", new long[] { 60*1000l, 60*60*1000l, 24*60*60*1000l });
//_state = 1; //_state = 1;
} }

View File

@@ -156,8 +156,7 @@ class PacketBuilder {
_context = ctx; _context = ctx;
_transport = transport; _transport = transport;
_log = ctx.logManager().getLog(PacketBuilder.class); _log = ctx.logManager().getLog(PacketBuilder.class);
_context.statManager().createRateStat("udp.packetAuthTime", "How long it takes to encrypt and MAC a packet for sending", "udp", UDPTransport.RATES); // all createRateStat in UDPTransport
_context.statManager().createRateStat("udp.packetAuthTimeSlow", "How long it takes to encrypt and MAC a packet for sending (when its slow)", "udp", UDPTransport.RATES);
} }
/**** /****

View File

@@ -250,6 +250,9 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
_context.statManager().createRateStat("udp.proactiveReestablish", "How long a session was idle for when we proactively reestablished it", "udp", RATES); _context.statManager().createRateStat("udp.proactiveReestablish", "How long a session was idle for when we proactively reestablished it", "udp", RATES);
_context.statManager().createRateStat("udp.dropPeerDroplist", "How many peers currently have their packets dropped outright when a new peer is added to the list?", "udp", RATES); _context.statManager().createRateStat("udp.dropPeerDroplist", "How many peers currently have their packets dropped outright when a new peer is added to the list?", "udp", RATES);
_context.statManager().createRateStat("udp.dropPeerConsecutiveFailures", "How many consecutive failed sends to a peer did we attempt before giving up and reestablishing a new session (lifetime is inactivity perood)", "udp", RATES); _context.statManager().createRateStat("udp.dropPeerConsecutiveFailures", "How many consecutive failed sends to a peer did we attempt before giving up and reestablishing a new session (lifetime is inactivity perood)", "udp", RATES);
// following are for PacketBuider
_context.statManager().createRateStat("udp.packetAuthTime", "How long it takes to encrypt and MAC a packet for sending", "udp", RATES);
_context.statManager().createRateStat("udp.packetAuthTimeSlow", "How long it takes to encrypt and MAC a packet for sending (when its slow)", "udp", RATES);
_context.simpleScheduler().addPeriodicEvent(new PingIntroducers(), MIN_EXPIRE_TIMEOUT * 3 / 4); _context.simpleScheduler().addPeriodicEvent(new PingIntroducers(), MIN_EXPIRE_TIMEOUT * 3 / 4);
} }