Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correcting several spellings #3333

Merged
merged 9 commits into from
Aug 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -233,7 +233,7 @@ public void setAccountStateRoot(byte[] root) {
this.block.getBlockHeader().toBuilder().setRawData(blockHeaderRaw)).build();
}

/* only for genisis */
/* only for genesis */
public void setWitness(String witness) {
BlockHeader.raw blockHeaderRaw =
this.block.getBlockHeader().getRawData().toBuilder().setWitnessAddress(
Original file line number Diff line number Diff line change
@@ -166,7 +166,7 @@ public String toString() {
+ " "
+ messageStatistics.discoverOutNeighbours + "/" + messageStatistics.discoverInFindNode
+ " "
+ ((int) discoverMessageLatency.getAvrg()) + "ms"
+ ((int) discoverMessageLatency.getAvg()) + "ms"
+ ", p2p: " + p2pHandShake + "/" + messageStatistics.p2pInHello + "/"
+ messageStatistics.p2pOutHello + " "
+ ", tron: " + messageStatistics.tronInMessage + "/" + messageStatistics.tronOutMessage
@@ -205,7 +205,7 @@ public void add(long value) {
count++;
}

public long getAvrg() {
public long getAvg() {
return count == 0 ? 0 : sum / count;
}

Original file line number Diff line number Diff line change
@@ -29,8 +29,8 @@ private int getPacketLossRateScore() {
}

private int getNetLatencyScore() {
return (int) (nodeStatistics.discoverMessageLatency.getAvrg() == 0 ? 0
: min(1000 / nodeStatistics.discoverMessageLatency.getAvrg(), 20));
return (int) (nodeStatistics.discoverMessageLatency.getAvg() == 0 ? 0
: min(1000 / nodeStatistics.discoverMessageLatency.getAvg(), 20));
}

private int getHandshakeScore() {
Original file line number Diff line number Diff line change
@@ -144,7 +144,7 @@ public synchronized void onConnect(Channel peer) {
activePeers.add(peerConnection);
activePeers
.sort(Comparator.comparingDouble(
c -> c.getNodeStatistics().pingMessageLatency.getAvrg()));
c -> c.getNodeStatistics().pingMessageLatency.getAvg()));
peerConnection.onConnect();
}
}
Original file line number Diff line number Diff line change
@@ -162,7 +162,7 @@ public String log() {

getNodeStatistics().pingMessageLatency.getCount(),
getNodeStatistics().pingMessageLatency.getMax(),
getNodeStatistics().pingMessageLatency.getAvrg(),
getNodeStatistics().pingMessageLatency.getAvg(),
getNodeStatistics().pingMessageLatency.getMin(),
getNodeStatistics().pingMessageLatency.getLast(),

Original file line number Diff line number Diff line change
@@ -131,7 +131,7 @@ private void setConnectInfo(NodeInfo nodeInfo) {
PeerInfo peerInfo = new PeerInfo();
peerInfo.setHeadBlockWeBothHave(peerConnection.getBlockBothHave().getString());
peerInfo.setActive(peerConnection.isActive());
peerInfo.setAvgLatency(peerConnection.getNodeStatistics().pingMessageLatency.getAvrg());
peerInfo.setAvgLatency(peerConnection.getNodeStatistics().pingMessageLatency.getAvg());
peerInfo.setBlockInPorcSize(peerConnection.getSyncBlockInProcess().size());
peerInfo.setConnectTime(peerConnection.getStartTime());
peerInfo.setDisconnectTimes(peerConnection.getNodeStatistics().getDisconnectTimes());
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ public void testNode() throws NoSuchFieldException, IllegalAccessException {
this.nodeStatistics.resetTcpFlow();
this.nodeStatistics.discoverMessageLatency.add(10);
this.nodeStatistics.discoverMessageLatency.add(20);
long avg = this.nodeStatistics.discoverMessageLatency.getAvrg();
long avg = this.nodeStatistics.discoverMessageLatency.getAvg();
Assert.assertEquals(15, avg);

}
Original file line number Diff line number Diff line change
@@ -90,9 +90,9 @@ public void testSolidityGrpcCall() {
DynamicProperties dynamicProperties = databaseGrpcClient.getDynamicProperties();
Assert.assertNotNull(dynamicProperties);

Block genisisBlock = databaseGrpcClient.getBlock(0);
Assert.assertNotNull(genisisBlock);
Assert.assertFalse(genisisBlock.getTransactionsList().isEmpty());
Block genesisBlock = databaseGrpcClient.getBlock(0);
Assert.assertNotNull(genesisBlock);
Assert.assertFalse(genesisBlock.getTransactionsList().isEmpty());
}

}