Stats: randomize router count at startup also

This commit is contained in:
zzz
2015-05-02 17:42:49 +00:00
parent bb33b358b4
commit e8bc0bd5d1

View File

@ -151,7 +151,10 @@ public class StatisticsManager implements Service {
// So that we will still get build requests
stats.setProperty("stat_uptime", "90m");
if (FloodfillNetworkDatabaseFacade.isFloodfill(_context.router().getRouterInfo())) {
stats.setProperty("netdb.knownRouters", String.valueOf(_context.netDb().getKnownRouters()));
int ri = _context.router().getUptime() > 30*60*1000 ?
_context.netDb().getKnownRouters() :
3000 + _context.random().nextInt(1000); // so it isn't obvious we restarted
stats.setProperty("netdb.knownRouters", String.valueOf(ri));
int ls = _context.router().getUptime() > 30*60*1000 ?
_context.netDb().getKnownLeaseSets() :
30 + _context.random().nextInt(40); // so it isn't obvious we restarted