Add comment, remove pointless code.

This commit is contained in:
chimp1984 2021-01-03 18:48:07 -05:00
parent 818c797f97
commit 77c405530d
No known key found for this signature in database
GPG Key ID: 9801B4EC591F90E3
2 changed files with 3 additions and 2 deletions

View File

@ -262,6 +262,9 @@ class RequestDataHandler implements MessageListener {
numPayloadsByClassName.putIfAbsent(className, new Tuple2<>(new AtomicInteger(0),
new AtomicInteger(0)));
numPayloadsByClassName.get(className).first.getAndIncrement();
// toProtoMessage().getSerializedSize() is not very cheap. For about 1500 objects it takes about 20 ms
// I think its justified to get accurate metrics but if it turns out to be a performance issue we might need
// to remove it and use some more rough estimation by taking only the size of one data type and multiply it.
numPayloadsByClassName.get(className).second.getAndAdd(networkPayload.toProtoMessage().getSerializedSize());
}

View File

@ -135,11 +135,9 @@ public class DummySeedNode {
checkArgument(arg.contains(":") && arg.split(":").length > 1 && arg.split(":")[1].length() > 3,
"Wrong program argument " + arg);
List<String> list = Arrays.asList(arg.split(","));
Set<NodeAddress> bannedPeers = new HashSet<>();
list.forEach(e -> {
checkArgument(e.contains(":") && e.split(":").length == 2 && e.split(":")[1].length() == 4,
"Wrong program argument " + e);
bannedPeers.add(new NodeAddress(e));
});
log.debug("From processArgs: ignoreList=" + list);
} else if (arg.startsWith(HELP)) {