Skip to content

Commit

Permalink
Merge pull request #771 from AntelopeIO/performance_harness_fix_2_0_c…
Browse files Browse the repository at this point in the history
…ompatibility

[PH] Repair Nodeos 2.0 Compatibility with Performance Tests
  • Loading branch information
ClaytonCalabrese committed Mar 2, 2023
2 parents 397293b + 480eb31 commit d745753
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 4 additions & 1 deletion tests/performance_tests/log_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,10 @@ def scrapeBlockTrxDataLog(trxDict, path):
#blockTrxData.txt
selectedopen = selectedOpen(path)
with selectedopen(path, 'rt') as f:
trxDict.update(dict([(x[0], trxData(blockNum=x[1], blockTime=x[2], cpuUsageUs=x[3], netUsageUs=x[4])) for x in (line.rstrip('\n').split(',') for line in f)]))
if Utils.getNodeosVersion().split('.')[0] == "v2":
trxDict.update(dict([(x[0], trxData(blockNum=x[1], cpuUsageUs=x[2], netUsageUs=x[3])) for x in (line.rstrip('\n').split(',') for line in f)]))
else:
trxDict.update(dict([(x[0], trxData(blockNum=x[1], blockTime=x[2], cpuUsageUs=x[3], netUsageUs=x[4])) for x in (line.rstrip('\n').split(',') for line in f)]))

def scrapeBlockDataLog(blockDict, path):
#blockData.txt
Expand Down
5 changes: 3 additions & 2 deletions tests/performance_tests/performance_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,15 +516,16 @@ def main():
httpPluginArgs = HttpPluginArgs(httpMaxResponseTimeMs=args.http_max_response_time_ms, httpMaxBytesInFlightMb=args.http_max_bytes_in_flight_mb,
httpThreads=args.http_threads)
netPluginArgs = NetPluginArgs(netThreads=args.net_threads, maxClients=0)
resourceMonitorPluginArgs = ResourceMonitorPluginArgs(resourceMonitorNotShutdownOnThresholdExceeded=True)
nodeosVers=Utils.getNodeosVersion().split('.')[0]
resourceMonitorPluginArgs = ResourceMonitorPluginArgs(resourceMonitorNotShutdownOnThresholdExceeded=not nodeosVers == "v2")
extraNodeosArgs = ENA(chainPluginArgs=chainPluginArgs, httpPluginArgs=httpPluginArgs, producerPluginArgs=producerPluginArgs, netPluginArgs=netPluginArgs,
resourceMonitorPluginArgs=resourceMonitorPluginArgs)
SC = PerformanceTestBasic.ClusterConfig.SpecifiedContract
specifiedContract=SC(contractDir=args.contract_dir, wasmFile=args.wasm_file, abiFile=args.abi_file, account=Account(args.account_name))
testClusterConfig = PerformanceTestBasic.ClusterConfig(pnodes=args.p, totalNodes=args.n, topo=args.s, genesisPath=args.genesis,
prodsEnableTraceApi=args.prods_enable_trace_api, extraNodeosArgs=extraNodeosArgs,
specifiedContract=specifiedContract,
nodeosVers=Utils.getNodeosVersion().split('.')[0])
nodeosVers=nodeosVers)

ptConfig = PerformanceTest.PtConfig(testDurationSec=args.test_iteration_duration_sec,
finalDurationSec=args.final_iterations_duration_sec,
Expand Down
5 changes: 3 additions & 2 deletions tests/performance_tests/performance_test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,8 @@ def main():
httpPluginArgs = HttpPluginArgs(httpMaxResponseTimeMs=args.http_max_response_time_ms, httpMaxBytesInFlightMb=args.http_max_bytes_in_flight_mb,
httpThreads=args.http_threads)
netPluginArgs = NetPluginArgs(netThreads=args.net_threads, maxClients=0)
resourceMonitorPluginArgs = ResourceMonitorPluginArgs(resourceMonitorNotShutdownOnThresholdExceeded=True)
nodeosVers=Utils.getNodeosVersion().split('.')[0]
resourceMonitorPluginArgs = ResourceMonitorPluginArgs(resourceMonitorNotShutdownOnThresholdExceeded=not nodeosVers == "v2")
ENA = PerformanceTestBasic.ClusterConfig.ExtraNodeosArgs
extraNodeosArgs = ENA(chainPluginArgs=chainPluginArgs, httpPluginArgs=httpPluginArgs, producerPluginArgs=producerPluginArgs, netPluginArgs=netPluginArgs,
resourceMonitorPluginArgs=resourceMonitorPluginArgs)
Expand All @@ -640,7 +641,7 @@ def main():
testClusterConfig = PerformanceTestBasic.ClusterConfig(pnodes=args.p, totalNodes=args.n, topo=args.s, genesisPath=args.genesis,
prodsEnableTraceApi=args.prods_enable_trace_api, extraNodeosArgs=extraNodeosArgs,
specifiedContract=specifiedContract, loggingLevel=args.cluster_log_lvl,
nodeosVers=Utils.getNodeosVersion().split('.')[0], nonProdsEosVmOcEnable=args.non_prods_eos_vm_oc_enable)
nodeosVers=nodeosVers, nonProdsEosVmOcEnable=args.non_prods_eos_vm_oc_enable)

if args.contracts_console and testClusterConfig.loggingLevel != "debug" and testClusterConfig.loggingLevel != "all":
print("Enabling contracts-console will not print anything unless debug level is 'debug' or higher."
Expand Down

0 comments on commit d745753

Please sign in to comment.