* Profile, DBHistory:
- Tweak the rate periods - Add a global fail rate stat - Increase the HashMap sizes
This commit is contained in:
@ -105,6 +105,7 @@ public class DBHistory {
|
||||
*/
|
||||
public RateStat getFailedLookupRate() { return _failedLookupRate; }
|
||||
|
||||
/** not sure how much this is used, to be investigated */
|
||||
public RateStat getInvalidReplyRate() { return _invalidReplyRate; }
|
||||
|
||||
/**
|
||||
@ -115,6 +116,7 @@ public class DBHistory {
|
||||
public void lookupSuccessful() {
|
||||
_successfulLookups++;
|
||||
_failedLookupRate.addData(0, 0);
|
||||
_context.statManager().addRateData("peer.failedLookupRate", 0, 0);
|
||||
_lastLookupSuccessful = _context.clock().now();
|
||||
}
|
||||
|
||||
@ -124,6 +126,7 @@ public class DBHistory {
|
||||
public void lookupFailed() {
|
||||
_failedLookups++;
|
||||
_failedLookupRate.addData(1, 0);
|
||||
_context.statManager().addRateData("peer.failedLookupRate", 1, 0);
|
||||
_lastLookupFailed = _context.clock().now();
|
||||
}
|
||||
|
||||
@ -136,6 +139,7 @@ public class DBHistory {
|
||||
// Fixme, redefined this to include both lookup and store fails,
|
||||
// need to fix the javadocs
|
||||
_failedLookupRate.addData(0, 0);
|
||||
_context.statManager().addRateData("peer.failedLookupRate", 0, 0);
|
||||
_lastStoreSuccessful = _context.clock().now();
|
||||
}
|
||||
|
||||
@ -275,9 +279,9 @@ public class DBHistory {
|
||||
|
||||
private void createRates(String statGroup) {
|
||||
if (_failedLookupRate == null)
|
||||
_failedLookupRate = new RateStat("dbHistory.failedLookupRate", "How often does this peer to respond to a lookup?", statGroup, new long[] { 60*1000l, 60*60*1000l, 24*60*60*1000l });
|
||||
_failedLookupRate = new RateStat("dbHistory.failedLookupRate", "How often does this peer to respond to a lookup?", statGroup, new long[] { 10*60*1000l, 60*60*1000l, 24*60*60*1000l });
|
||||
if (_invalidReplyRate == null)
|
||||
_invalidReplyRate = new RateStat("dbHistory.invalidReplyRate", "How often does this peer give us a bad (nonexistant, forged, etc) peer?", statGroup, new long[] { 30*60*1000l, 60*60*1000l, 24*60*60*1000l });
|
||||
_invalidReplyRate = new RateStat("dbHistory.invalidReplyRate", "How often does this peer give us a bad (nonexistant, forged, etc) peer?", statGroup, new long[] { 30*60*1000l });
|
||||
_failedLookupRate.setStatLog(_context.statManager().getStatLog());
|
||||
_invalidReplyRate.setStatLog(_context.statManager().getStatLog());
|
||||
}
|
||||
|
@ -97,10 +97,10 @@ public class ProfileOrganizer {
|
||||
_log = context.logManager().getLog(ProfileOrganizer.class);
|
||||
_comp = new InverseCapacityComparator();
|
||||
_fastPeers = new HashMap(16);
|
||||
_highCapacityPeers = new HashMap(16);
|
||||
_highCapacityPeers = new HashMap(32);
|
||||
_wellIntegratedPeers = new HashMap(16);
|
||||
_notFailingPeers = new HashMap(64);
|
||||
_notFailingPeersList = new ArrayList(64);
|
||||
_notFailingPeers = new HashMap(256);
|
||||
_notFailingPeersList = new ArrayList(256);
|
||||
_failingPeers = new HashMap(16);
|
||||
_strictCapacityOrder = new TreeSet(_comp);
|
||||
_thresholdSpeedValue = 0.0d;
|
||||
@ -113,6 +113,8 @@ public class ProfileOrganizer {
|
||||
_context.statManager().createRateStat("peer.profileThresholdTime", "How long the reorg takes determining the tier thresholds", "Peers", new long[] { 10*60*1000 });
|
||||
_context.statManager().createRateStat("peer.profilePlaceTime", "How long the reorg takes placing peers in the tiers", "Peers", new long[] { 10*60*1000 });
|
||||
_context.statManager().createRateStat("peer.profileReorgTime", "How long the reorg takes overall", "Peers", new long[] { 10*60*1000 });
|
||||
// used in DBHistory
|
||||
_context.statManager().createRateStat("peer.failedLookupRate", "DB Lookup fail rate", "Peers", new long[] { 10*60*1000l, 60*60*1000l, 24*60*60*1000l });
|
||||
}
|
||||
|
||||
private void getReadLock() {
|
||||
|
Reference in New Issue
Block a user