Stats: 4 stats no longer required (thx drzed)

This commit is contained in:
zzz
2020-02-11 13:51:12 +00:00
parent fe16ccb434
commit 17060c0100
3 changed files with 4 additions and 28 deletions

View File

@ -781,30 +781,6 @@ public class SummaryHelper extends HelperBase {
return String.valueOf(_context.tunnelManager().getInboundBuildQueueSize()); return String.valueOf(_context.tunnelManager().getInboundBuildQueueSize());
} }
/*******
public String getPRNGStatus() {
Rate r = _context.statManager().getRate("prng.bufferWaitTime").getRate(60*1000);
int use = (int) r.getLastEventCount();
int i = (int) (r.getAverageValue() + 0.5);
if (i <= 0) {
r = _context.statManager().getRate("prng.bufferWaitTime").getRate(10*60*1000);
i = (int) (r.getAverageValue() + 0.5);
}
String rv = i + "/";
r = _context.statManager().getRate("prng.bufferFillTime").getRate(60*1000);
i = (int) (r.getAverageValue() + 0.5);
if (i <= 0) {
r = _context.statManager().getRate("prng.bufferFillTime").getRate(10*60*1000);
i = (int) (r.getAverageValue() + 0.5);
}
rv = rv + i + "ms";
// margin == fill time / use time
if (use > 0 && i > 0)
rv = rv + ' ' + (60*1000 / (use * i)) + 'x';
return rv;
}
********/
private static boolean updateAvailable() { private static boolean updateAvailable() {
return NewsHelper.isUpdateAvailable(); return NewsHelper.isUpdateAvailable();
} }

View File

@ -45,8 +45,8 @@ public class AsyncFortunaStandalone extends FortunaStandalone implements Runnabl
_emptyBuffers = new LinkedBlockingQueue<AsyncBuffer>(_bufferCount); _emptyBuffers = new LinkedBlockingQueue<AsyncBuffer>(_bufferCount);
_fullBuffers = new LinkedBlockingQueue<AsyncBuffer>(_bufferCount); _fullBuffers = new LinkedBlockingQueue<AsyncBuffer>(_bufferCount);
_context = context; _context = context;
context.statManager().createRequiredRateStat("prng.bufferWaitTime", "Delay for random number buffer (ms)", "Encryption", new long[] { 60*1000, 10*60*1000, 60*60*1000 } ); context.statManager().createRateStat("prng.bufferWaitTime", "Delay for random number buffer (ms)", "Encryption", new long[] { 60*1000, 10*60*1000, 60*60*1000 } );
context.statManager().createRequiredRateStat("prng.bufferFillTime", "Time to fill random number buffer (ms)", "Encryption", new long[] { 60*1000, 10*60*1000, 60*60*1000 } ); context.statManager().createRateStat("prng.bufferFillTime", "Time to fill random number buffer (ms)", "Encryption", new long[] { 60*1000, 10*60*1000, 60*60*1000 } );
_log = context.logManager().getLog(AsyncFortunaStandalone.class); _log = context.logManager().getLog(AsyncFortunaStandalone.class);
} }

View File

@ -70,10 +70,10 @@ public final class ElGamalEngine {
* *
*/ */
public ElGamalEngine(I2PAppContext context) { public ElGamalEngine(I2PAppContext context) {
context.statManager().createRequiredRateStat("crypto.elGamal.encrypt", context.statManager().createRateStat("crypto.elGamal.encrypt",
"Time for ElGamal encryption (ms)", "Encryption", "Time for ElGamal encryption (ms)", "Encryption",
new long[] { 60 * 60 * 1000}); new long[] { 60 * 60 * 1000});
context.statManager().createRequiredRateStat("crypto.elGamal.decrypt", context.statManager().createRateStat("crypto.elGamal.decrypt",
"Time for ElGamal decryption (ms)", "Encryption", "Time for ElGamal decryption (ms)", "Encryption",
new long[] { 60 * 60 * 1000}); new long[] { 60 * 60 * 1000});
_context = context; _context = context;