Skip to content

Commit

Permalink
Merge pull request #829 from AntelopeIO/ph-fix-bug-and-arg-passing
Browse files Browse the repository at this point in the history
[PH] fix bug and arg passing
  • Loading branch information
oschwaldp-oci authored Mar 16, 2023
2 parents 58d6eb0 + ed5aeca commit d4ffa14
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions tests/performance_tests/performance_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def __init__(self, testHelperConfig: PerformanceTestBasic.TestHelperConfig=Perfo
logDirTimestamp=f"{self.testsStart.strftime('%Y-%m-%d_%H-%M-%S')}")

def performPtbBinarySearch(self, clusterConfig: PerformanceTestBasic.ClusterConfig, logDirRoot: Path, delReport: bool, quiet: bool, delPerfLogs: bool) -> TpsTestResult.PerfTestSearchResults:
floor = 0
floor = 1
ceiling = self.ptConfig.maxTpsToTest
binSearchTarget = self.ptConfig.maxTpsToTest
minStep = self.ptConfig.testIterationMinStep
Expand Down Expand Up @@ -141,8 +141,8 @@ def performPtbBinarySearch(self, clusterConfig: PerformanceTestBasic.ClusterConf

def performPtbReverseLinearSearch(self, tpsInitial: int) -> TpsTestResult.PerfTestSearchResults:

# Default - Decrementing Max TPS in range [0, tpsInitial]
absFloor = 0
# Default - Decrementing Max TPS in range [1, tpsInitial]
absFloor = 1
absCeiling = tpsInitial

step = self.ptConfig.testIterationMinStep
Expand Down Expand Up @@ -170,7 +170,10 @@ def performPtbReverseLinearSearch(self, tpsInitial: int) -> TpsTestResult.PerfTe
scenarioResult.success = True
maxFound = True
else:
searchTarget = searchTarget - step
if searchTarget == absFloor:
# This means it has already run a search at absFloor, and failed, so exit.
maxFound = True
searchTarget = max(searchTarget - step, absFloor)

scenarioResult.basicTestResult = ptbResult
searchResults.append(scenarioResult)
Expand Down Expand Up @@ -503,30 +506,38 @@ def main():
dumpErrorDetails=args.dump_error_details, delay=args.d, nodesFile=args.nodes_file,
verbose=args.v)

ENA = PerformanceTestBasic.ClusterConfig.ExtraNodeosArgs
chainPluginArgs = ChainPluginArgs(signatureCpuBillablePct=args.signature_cpu_billable_pct,
chainThreads=args.chain_threads, databaseMapMode=args.database_map_mode,
wasmRuntime=args.wasm_runtime, contractsConsole=args.contracts_console,
eosVmOcCacheSizeMb=args.eos_vm_oc_cache_size_mb, eosVmOcCompileThreads=args.eos_vm_oc_compile_threads,
blockLogRetainBlocks=args.block_log_retain_blocks,
abiSerializerMaxTimeMs=990000, chainStateDbSizeMb=256000)
chainStateDbSizeMb=args.chain_state_db_size_mb, abiSerializerMaxTimeMs=990000)

lbto = args.last_block_time_offset_us
lbcep = args.last_block_cpu_effort_percent
if args.p > 1 and lbto == 0 and lbcep == 100:
print("Overriding defaults for last_block_time_offset_us and last_block_cpu_effort_percent to ensure proper production windows.")
lbto = -200000
lbcep = 80
producerPluginArgs = ProducerPluginArgs(disableSubjectiveBilling=args.disable_subjective_billing,
lastBlockTimeOffsetUs=args.last_block_time_offset_us, produceTimeOffsetUs=args.produce_time_offset_us,
cpuEffortPercent=args.cpu_effort_percent, lastBlockCpuEffortPercent=args.last_block_cpu_effort_percent,
lastBlockTimeOffsetUs=lbto, produceTimeOffsetUs=args.produce_time_offset_us,
cpuEffortPercent=args.cpu_effort_percent, lastBlockCpuEffortPercent=lbcep,
producerThreads=args.producer_threads, maxTransactionTime=-1)
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)
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)
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=nodeosVers)
specifiedContract=specifiedContract, loggingLevel=args.cluster_log_lvl,
nodeosVers=nodeosVers, nonProdsEosVmOcEnable=args.non_prods_eos_vm_oc_enable)


ptConfig = PerformanceTest.PtConfig(testDurationSec=args.test_iteration_duration_sec,
finalDurationSec=args.final_iterations_duration_sec,
Expand Down

0 comments on commit d4ffa14

Please sign in to comment.