Skip to content

Commit

Permalink
Addressing peer review comments.
Browse files Browse the repository at this point in the history
Newer versions of Python, e.g. 3.11 require use of default_factory in dataclasses.

Newer versions of python/numpy no longer require np predicate before float, and can use float directly.
  • Loading branch information
oschwaldp-oci committed Mar 9, 2023
1 parent c6717c4 commit 045db81
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tests/performance_tests/log_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ def calcTrxLatencyCpuNetStats(trxDict : dict, blockDict: dict):
"""
trxLatencyCpuNetList = [(data.latency, data.cpuUsageUs, data.netUsageUs) for trxId, data in trxDict.items() if data.calcdTimeEpoch != 0]

npLatencyCpuNetList = np.array(trxLatencyCpuNetList, dtype=np.float)
npLatencyCpuNetList = np.array(trxLatencyCpuNetList, dtype=float)

return basicStats(float(np.min(npLatencyCpuNetList[:,0])), float(np.max(npLatencyCpuNetList[:,0])), float(np.average(npLatencyCpuNetList[:,0])), float(np.std(npLatencyCpuNetList[:,0])), len(npLatencyCpuNetList)), \
basicStats(float(np.min(npLatencyCpuNetList[:,1])), float(np.max(npLatencyCpuNetList[:,1])), float(np.average(npLatencyCpuNetList[:,1])), float(np.std(npLatencyCpuNetList[:,1])), len(npLatencyCpuNetList)), \
Expand Down
20 changes: 10 additions & 10 deletions tests/performance_tests/performance_test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ class ClusterConfig:
@dataclass
class ExtraNodeosArgs:

chainPluginArgs: ChainPluginArgs = ChainPluginArgs()
httpPluginArgs: HttpPluginArgs = HttpPluginArgs()
netPluginArgs: NetPluginArgs = NetPluginArgs()
producerPluginArgs: ProducerPluginArgs = ProducerPluginArgs()
resourceMonitorPluginArgs: ResourceMonitorPluginArgs = ResourceMonitorPluginArgs()
signatureProviderPluginArgs: SignatureProviderPluginArgs = SignatureProviderPluginArgs()
stateHistoryPluginArgs: StateHistoryPluginArgs = StateHistoryPluginArgs()
traceApiPluginArgs: TraceApiPluginArgs = TraceApiPluginArgs()
chainPluginArgs: ChainPluginArgs = field(default_factory=ChainPluginArgs)
httpPluginArgs: HttpPluginArgs = field(default_factory=HttpPluginArgs)
netPluginArgs: NetPluginArgs = field(default_factory=NetPluginArgs)
producerPluginArgs: ProducerPluginArgs = field(default_factory=ProducerPluginArgs)
resourceMonitorPluginArgs: ResourceMonitorPluginArgs = field(default_factory=ResourceMonitorPluginArgs)
signatureProviderPluginArgs: SignatureProviderPluginArgs = field(default_factory=SignatureProviderPluginArgs)
stateHistoryPluginArgs: StateHistoryPluginArgs = field(default_factory=StateHistoryPluginArgs)
traceApiPluginArgs: TraceApiPluginArgs = field(default_factory=TraceApiPluginArgs)

def __str__(self) -> str:
args = []
Expand All @@ -78,8 +78,8 @@ class SpecifiedContract:
pnodes: int = 1
totalNodes: int = 2
topo: str = "mesh"
extraNodeosArgs: ExtraNodeosArgs = ExtraNodeosArgs()
specifiedContract: SpecifiedContract = SpecifiedContract()
extraNodeosArgs: ExtraNodeosArgs = field(default_factory=ExtraNodeosArgs)
specifiedContract: SpecifiedContract = field(default_factory=SpecifiedContract)
useBiosBootFile: bool = False
genesisPath: Path = Path("tests")/"performance_tests"/"genesis.json"
maximumP2pPerHost: int = 5000
Expand Down

0 comments on commit 045db81

Please sign in to comment.