-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
68 changed files
with
193,250 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
13654441 nano seconds | ||
|
||
15776763 nano seconds | ||
|
||
6565114 nano seconds | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
13699099 nano seconds | ||
|
||
6507546 nano seconds | ||
|
||
5973273 nano seconds | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
52082638 nano seconds | ||
|
||
5822737 nano seconds | ||
|
||
12261205 nano seconds | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]))) |
Oops, something went wrong.