SSU: addRateData() cleanup

This commit is contained in:
zzz
2016-09-22 17:13:42 +00:00
parent 32e1c9617e
commit 4ab727acbd
5 changed files with 11 additions and 11 deletions

View File

@@ -410,7 +410,7 @@ class EstablishmentManager {
if (_log.shouldLog(Log.WARN))
_log.warn("Too many pending, rejecting outbound establish to " + to);
_transport.failed(msg, "Too many pending outbound connections");
_context.statManager().addRateData("udp.establishRejected", deferred, 0);
_context.statManager().addRateData("udp.establishRejected", deferred);
return;
}
if (queueCount >= MAX_QUEUED_PER_PEER) {
@@ -732,7 +732,7 @@ class EstablishmentManager {
_transport.inboundConnectionReceived(isIPv6);
_transport.setIP(remote.calculateHash(), state.getSentIP());
_context.statManager().addRateData("udp.inboundEstablishTime", state.getLifetime(), 0);
_context.statManager().addRateData("udp.inboundEstablishTime", state.getLifetime());
sendInboundComplete(peer);
OutNetMessage msg;
while ((msg = state.getNextQueuedMessage()) != null) {
@@ -832,7 +832,7 @@ class EstablishmentManager {
_transport.addRemotePeerState(peer);
_transport.setIP(remote.calculateHash(), state.getSentIP());
_context.statManager().addRateData("udp.outboundEstablishTime", state.getLifetime(), 0);
_context.statManager().addRateData("udp.outboundEstablishTime", state.getLifetime());
DatabaseStoreMessage dbsm = null;
if (!state.isFirstMessageOurDSM()) {
dbsm = getOurInfo();
@@ -941,7 +941,7 @@ class EstablishmentManager {
} while (old != null);
state.setIntroNonce(nonce);
}
_context.statManager().addRateData("udp.sendIntroRelayRequest", 1, 0);
_context.statManager().addRateData("udp.sendIntroRelayRequest", 1);
List<UDPPacket> requests = _builder.buildRelayRequest(_transport, state, _transport.getIntroKey());
if (requests.isEmpty()) {
// FIXME need a failed OB state
@@ -989,7 +989,7 @@ class EstablishmentManager {
// TODO either put the nonce back in liveintroductions, or fail
return;
}
_context.statManager().addRateData("udp.receiveIntroRelayResponse", state.getLifetime(), 0);
_context.statManager().addRateData("udp.receiveIntroRelayResponse", state.getLifetime());
if (_log.shouldLog(Log.INFO))
_log.info("Received RelayResponse for " + state.getRemoteIdentity().calculateHash() + " - they are on "
+ addr.toString() + ":" + port + " (according to " + bob + ") nonce=" + nonce);
@@ -1230,7 +1230,7 @@ class EstablishmentManager {
break;
case IB_STATE_COMPLETE: // fall through
case IB_STATE_FAILED:
case IB_STATE_FAILED: // leak here if fail() was called in IES???
break; // already removed;
case IB_STATE_UNKNOWN:
@@ -1387,7 +1387,7 @@ class EstablishmentManager {
if (removed) {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Send intro for " + outboundState + " timed out");
_context.statManager().addRateData("udp.sendIntroRelayTimeout", 1, 0);
_context.statManager().addRateData("udp.sendIntroRelayTimeout", 1);
}
}
// only if == state

View File

@@ -217,7 +217,7 @@ class InboundMessageFragments /*implements UDPTransport.PartialACKSource */{
int ackCount = data.readACKCount();
if (ackCount > 0) {
rv += ackCount;
_context.statManager().addRateData("udp.receivedACKs", ackCount, 0);
_context.statManager().addRateData("udp.receivedACKs", ackCount);
//_context.statManager().getStatLog().addData(from.getRemoteHostId().toString(), "udp.peer.receiveACKCount", acks.length, 0);
for (int i = 0; i < ackCount; i++) {

View File

@@ -222,7 +222,7 @@ class OutboundMessageFragments {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Add a new message to an existing peer " + peer.getRemotePeer());
}
_context.statManager().addRateData("udp.outboundActivePeers", _activePeers.size(), 0);
_context.statManager().addRateData("udp.outboundActivePeers", _activePeers.size());
// Avoid sync if possible
// no, this doesn't always work.

View File

@@ -312,7 +312,7 @@ class UDPSender {
UDPPacket packet = null;
while ( (_keepRunning) && (packet == null || packet.getLifetime() > MAX_HEAD_LIFETIME) ) {
if (packet != null) {
_context.statManager().addRateData("udp.sendQueueTrimmed", 1, 0);
_context.statManager().addRateData("udp.sendQueueTrimmed", 1);
packet.release();
}
try {

View File

@@ -1324,7 +1324,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
_introManager.add(peer);
if (oldEstablishedOn > 0)
_context.statManager().addRateData("udp.alreadyConnected", oldEstablishedOn, 0);
_context.statManager().addRateData("udp.alreadyConnected", oldEstablishedOn);
synchronized(_rebuildLock) {
rebuildIfNecessary();