summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Gieseke <eric_gieseke@yahoo.com>2022-01-27 09:35:15 -0500
committerGitHub <noreply@github.com>2022-01-27 09:35:15 -0500
commit93a372d085dfa6305e6d3dba95df5279980a545e (patch)
tree0496c7033c9517dc99ec08e24c0bd79c847cba7d
parent1b32087ed98353b0f1b096c9b260055d349735c6 (diff)
Add bandwidth testing (#3487)
To support performance testing with bandwidth collection, updated Hello World recipe so that it works, and specify UTF-8 encoding when processing metrics files.
-rw-r--r--test/heapwatch/metrics_delta.py36
-rw-r--r--test/testdata/deployednettemplates/recipes/hello-world/genesis.json17
-rw-r--r--test/testdata/deployednettemplates/recipes/hello-world/net.json46
-rw-r--r--test/testdata/deployednettemplates/recipes/hello-world/topology.json8
4 files changed, 88 insertions, 19 deletions
diff --git a/test/heapwatch/metrics_delta.py b/test/heapwatch/metrics_delta.py
index 937159145..b6aa2ae8a 100644
--- a/test/heapwatch/metrics_delta.py
+++ b/test/heapwatch/metrics_delta.py
@@ -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
@@ -396,12 +400,12 @@ class nodestats:
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{}'))
diff --git a/test/testdata/deployednettemplates/recipes/hello-world/genesis.json b/test/testdata/deployednettemplates/recipes/hello-world/genesis.json
index ac841670c..218b694d5 100644
--- a/test/testdata/deployednettemplates/recipes/hello-world/genesis.json
+++ b/test/testdata/deployednettemplates/recipes/hello-world/genesis.json
@@ -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
}
]
}
diff --git a/test/testdata/deployednettemplates/recipes/hello-world/net.json b/test/testdata/deployednettemplates/recipes/hello-world/net.json
index 7d03c4669..08b885f17 100644
--- a/test/testdata/deployednettemplates/recipes/hello-world/net.json
+++ b/test/testdata/deployednettemplates/recipes/hello-world/net.json
@@ -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 }"
+ }
+ ]
}
]
}
diff --git a/test/testdata/deployednettemplates/recipes/hello-world/topology.json b/test/testdata/deployednettemplates/recipes/hello-world/topology.json
index ef4f4ac8c..acc7cca9e 100644
--- a/test/testdata/deployednettemplates/recipes/hello-world/topology.json
+++ b/test/testdata/deployednettemplates/recipes/hello-world/topology.json
@@ -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"
}
]
}