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

Add bandwidth testing #3487

Merged
merged 13 commits into from
Jan 27, 2022
36 changes: 20 additions & 16 deletions test/heapwatch/metrics_delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,24 @@ def test_metric_line_re():

def parse_metrics(fin):
out = dict()
for line in fin:
if not line:
continue
line = line.strip()
if not line:
continue
if line[0] == '#':
continue
m = metric_line_re.match(line)
if m:
out[m.group(1)] = num(m.group(2))
else:
ab = line.split()
out[ab[0]] = num(ab[1])
try:
for line in fin:
if not line:
continue
line = line.strip()
if not line:
continue
if line[0] == '#':
continue
m = metric_line_re.match(line)
if m:
out[m.group(1)] = num(m.group(2))
else:
ab = line.split()
out[ab[0]] = num(ab[1])
except:
print(f'An exception occurred in parse_metrics: {sys.exc_info()}')
pass
return out

# return b-a
Expand Down Expand Up @@ -396,12 +400,12 @@ def process_files(self, args, nick=None, metrics_files=None):
prevbi = None

for path in sorted(metrics_files):
with open(path, 'rt') as fin:
with open(path, 'rt', encoding="utf-8") as fin:
cur = parse_metrics(fin)
bijsonpath = path.replace('.metrics', '.blockinfo.json')
bi = None
if os.path.exists(bijsonpath):
with open(bijsonpath, 'rt') as fin:
with open(bijsonpath, 'rt', encoding="utf-8") as fin:
bi = json.load(fin)
curtime = os.path.getmtime(path)
self.txPool.append(cur.get('algod_tx_pool_count{}'))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
{
"NetworkName": "",
"VersionModifier": "",
"ConsensusProtocol": "",
"ConsensusProtocol": "future",
"FirstPartKeyRound": 0,
"LastPartKeyRound": 1000300,
"PartKeyDilution": 0,
"Wallets": [
{
"Name": "Wallet1",
"Stake": 50,
"Stake": 25,
"Online": true
},
{
"Name": "Wallet2",
"Stake": 50,
"Stake": 25,
"Online": true
},
{
"Name": "Wallet3",
"Stake": 25,
"Online": true
},
{
"Name": "Wallet4",
"Stake": 25,
"Online": false
}
]
}
46 changes: 46 additions & 0 deletions test/testdata/deployednettemplates/recipes/hello-world/net.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,52 @@
"ConfigJSONOverride": "{ \"DNSBootstrapID\": \"<network>.algodev.network\",\"DeadlockDetection\": -1, \"PeerPingPeriodSeconds\": 30, \"EnableAgreementReporting\": true, \"EnableAgreementTimeMetrics\": true, \"EnableAssembleStats\": true, \"EnableProcessBlockStats\": true }"
}
]
},
{
"Name": "N1",
"Group": "",
"Nodes": [
{
"Name": "node1",
"Wallets": [
{
"Name": "Wallet3",
"ParticipationOnly": false
}
],
"APIEndpoint": "{{APIEndpoint}}",
"APIToken": "{{APIToken}}",
"EnableTelemetry": false,
"TelemetryURI": "{{TelemetryURI}}",
"EnableMetrics": false,
"MetricsURI": "{{MetricsURI}}",
"EnableService": false,
"EnableBlockStats": false,
"ConfigJSONOverride": "{ \"TxPoolExponentialIncreaseFactor\": 1, \"DNSBootstrapID\": \"<network>.algodev.network\", \"DeadlockDetection\": -1, \"PeerPingPeriodSeconds\": 30, \"BaseLoggerDebugLevel\": 4, \"EnableProfiler\": true, \"CadaverSizeTarget\": 0, \"EnableAccountUpdatesStats\": true}"
}
]
},
{
"Name": "NPN1",
"Group": "",
"Nodes": [
{
"Name": "nonParticipatingNode1",
"Wallets": [
{
"Name": "Wallet4",
"ParticipationOnly": false
}
],
"APIEndpoint": "{{APIEndpoint}}",
"APIToken": "{{APIToken}}",
"EnableTelemetry": false,
"EnableMetrics": false,
"EnableService": false,
"EnableBlockStats": false,
"ConfigJSONOverride": "{ \"TxPoolExponentialIncreaseFactor\": 1, \"DNSBootstrapID\": \"<network>.algodev.network\", \"DeadlockDetection\": -1, \"BaseLoggerDebugLevel\": 4, \"CadaverSizeTarget\": 0 }"
}
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
{
"Name": "R2",
"Template": "AWS-US-EAST-1-Small"
},
{
"Name": "N1",
"Template": "AWS-US-EAST-1-Small"
},
{
"Name": "NPN1",
"Template": "AWS-US-EAST-1-Small"
}
]
}