set firstHeardAbout; tweak dump order

This commit is contained in:
zzz
2011-03-20 13:34:14 +00:00
parent c0422134f9
commit fa8f2290af
5 changed files with 26 additions and 5 deletions

View File

@@ -1,3 +1,16 @@
2011-03-20 zzz
* Console: Remove cache directives
* i2psnark: Fix peers stuck at uninteresting after metainfo fetch
* i2ptunnel: Change all clients to 3 hops by default (new installs only)
* Profiles:
- Nicer profile dump
- More efficient profile lookup for display
- Fix dumpprofile NPE
- Change file suffix from .dat to .txt.gz
- Set firstHeardAbout on creation
* Rate: Fix equals()
* Recognize links and links2 as text browsers
2011-03-12 zzz 2011-03-12 zzz
* Blocklist: Add bogons since they won't change any more * Blocklist: Add bogons since they won't change any more
* BuildHandler: Loop double-check * BuildHandler: Loop double-check

View File

@@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Monotone"; public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 6; public final static long BUILD = 7;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = ""; public final static String EXTRA = "";

View File

@@ -62,6 +62,10 @@ public class PeerProfile {
public PeerProfile(RouterContext context, Hash peer) { public PeerProfile(RouterContext context, Hash peer) {
this(context, peer, true); this(context, peer, true);
} }
/**
* @param expand must be true (see below)
*/
public PeerProfile(RouterContext context, Hash peer, boolean expand) { public PeerProfile(RouterContext context, Hash peer, boolean expand) {
_context = context; _context = context;
_log = context.logManager().getLog(PeerProfile.class); _log = context.logManager().getLog(PeerProfile.class);
@@ -125,7 +129,10 @@ public class PeerProfile {
} }
/** when did we first hear about this peer? */ /**
* When did we first hear about this peer?
* Currently unused, candidate for removal.
*/
public long getFirstHeardAbout() { return _firstHeardAbout; } public long getFirstHeardAbout() { return _firstHeardAbout; }
public void setFirstHeardAbout(long when) { _firstHeardAbout = when; } public void setFirstHeardAbout(long when) { _firstHeardAbout = when; }

View File

@@ -341,6 +341,7 @@ public class ProfileManagerImpl implements ProfileManager {
PeerProfile prof = _context.profileOrganizer().getProfile(peer); PeerProfile prof = _context.profileOrganizer().getProfile(peer);
if (prof == null) { if (prof == null) {
prof = new PeerProfile(_context, peer); prof = new PeerProfile(_context, peer);
prof.setFirstHeardAbout(_context.clock().now());
_context.profileOrganizer().addProfile(prof); _context.profileOrganizer().addProfile(prof);
} }
return prof; return prof;

View File

@@ -119,14 +119,14 @@ class ProfilePersistenceHelper {
buf.append("#").append(NL); buf.append("#").append(NL);
buf.append("########################################################################").append(NL); buf.append("########################################################################").append(NL);
buf.append("##").append(NL); buf.append("##").append(NL);
add(buf, "speedBonus", profile.getSpeedBonus(), "Manual adjustment to the speed score");
add(buf, "capacityBonus", profile.getCapacityBonus(), "Manual adjustment to the capacity score"); add(buf, "capacityBonus", profile.getCapacityBonus(), "Manual adjustment to the capacity score");
add(buf, "integrationBonus", profile.getIntegrationBonus(), "Manual adjustment to the integration score"); add(buf, "integrationBonus", profile.getIntegrationBonus(), "Manual adjustment to the integration score");
add(buf, "speedBonus", profile.getSpeedBonus(), "Manual adjustment to the speed score");
addDate(buf, "lastHeardAbout", profile.getLastHeardAbout(), "When did we last get a reference to this peer?");
addDate(buf, "firstHeardAbout", profile.getFirstHeardAbout(), "When did we first get a reference to this peer?"); addDate(buf, "firstHeardAbout", profile.getFirstHeardAbout(), "When did we first get a reference to this peer?");
addDate(buf, "lastHeardAbout", profile.getLastHeardAbout(), "When did we last get a reference to this peer?");
addDate(buf, "lastHeardFrom", profile.getLastHeardFrom(), "When did we last get a message from the peer?");
addDate(buf, "lastSentToSuccessfully", profile.getLastSendSuccessful(), "When did we last send the peer a message successfully?"); addDate(buf, "lastSentToSuccessfully", profile.getLastSendSuccessful(), "When did we last send the peer a message successfully?");
addDate(buf, "lastFailedSend", profile.getLastSendFailed(), "When did we last fail to send a message to the peer?"); addDate(buf, "lastFailedSend", profile.getLastSendFailed(), "When did we last fail to send a message to the peer?");
addDate(buf, "lastHeardFrom", profile.getLastHeardFrom(), "When did we last get a message from the peer?");
add(buf, "tunnelTestTimeAverage", profile.getTunnelTestTimeAverage(), "Moving average as to how fast the peer replies"); add(buf, "tunnelTestTimeAverage", profile.getTunnelTestTimeAverage(), "Moving average as to how fast the peer replies");
add(buf, "tunnelPeakThroughput", profile.getPeakThroughputKBps(), "KBytes/sec"); add(buf, "tunnelPeakThroughput", profile.getPeakThroughputKBps(), "KBytes/sec");
add(buf, "tunnelPeakTunnelThroughput", profile.getPeakTunnelThroughputKBps(), "KBytes/sec"); add(buf, "tunnelPeakTunnelThroughput", profile.getPeakTunnelThroughputKBps(), "KBytes/sec");