Skip to content

Commit

Permalink
Add performance Evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
hoang-ho committed Mar 17, 2021
1 parent 7964e9a commit acedd52
Show file tree
Hide file tree
Showing 68 changed files with 193,250 additions and 0 deletions.
73 changes: 73 additions & 0 deletions TestCase3Modified.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"N": "7",
"K": "4",
"network": [
{
"id": "0",
"IPAddress": "localhost",
"port": "8080",
"neighbors": [
"3",
"1"
]
},
{
"id": "1",
"IPAddress": "localhost",
"port": "8081",
"neighbors": [
"0",
"2",
"3"
]
},
{
"id": "2",
"IPAddress": "localhost",
"port": "8082",
"neighbors": [
"1",
"3",
"4"
]
},
{
"id": "3",
"IPAddress": "localhost",
"port": "8083",
"neighbors": [
"0",
"1",
"2",
"5"
]
},
{
"id": "4",
"IPAddress": "localhost",
"port": "8084",
"neighbors": [
"2",
"6"
]
},
{
"id": "5",
"IPAddress": "localhost",
"port": "8085",
"neighbors": [
"3",
"6"
]
},
{
"id": "6",
"IPAddress": "localhost",
"port": "8086",
"neighbors": [
"4",
"5"
]
}
]
}
6 changes: 6 additions & 0 deletions buyRPCLatency_0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
13654441 nano seconds

15776763 nano seconds

6565114 nano seconds

6 changes: 6 additions & 0 deletions buyRPCLatency_1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
13699099 nano seconds

6507546 nano seconds

5973273 nano seconds

6 changes: 6 additions & 0 deletions buyRPCLatency_2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
52082638 nano seconds

5822737 nano seconds

12261205 nano seconds

23 changes: 23 additions & 0 deletions data/CalculateAvg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import sys

def calculate(textFile, skip=0):
total = 0
count = 0
with open(textFile, "r") as fd:
# skip the first few lines because the way the file is formatted and
# because the first few replies are slow due to the server/peers startup late
# we allow peer to all start up and start counting
lines = fd.readlines()[skip:]

for line in lines:
vals = line.split(" ")
if (vals[0] != "\n"):
total += int(vals[0])
count += 1

return (total / count)



if __name__ == "__main__":
print(calculate(sys.argv[1], int(sys.argv[2])))
Loading

0 comments on commit acedd52

Please sign in to comment.