Skip to content

Commit

Permalink
quiet excessive logging and misc. cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesob committed Feb 2, 2024
1 parent ea8143a commit 0a1d6f5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
9 changes: 5 additions & 4 deletions runner/bitcoind.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,11 @@ def call_rpc(self, cmd,
self, call)
return None

if not deserialize_output:
logger.debug("rpc: %r -> %r", cmd, call.stdout)
else:
logger.debug("response for %r:\n%s", cmd, json.loads(call.stdout))
if config.BITCOINPERF_TRACE:
if not deserialize_output:
logger.debug("rpc: %r -> %r", cmd, call.stdout)
else:
logger.debug("response for %r:\n%s", cmd, json.loads(call.stdout))

return json.loads(call.stdout) if deserialize_output else None

Expand Down
6 changes: 4 additions & 2 deletions runner/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
logger = logging.get_logger()

# Get physical memory specs
MEM_GIB = os.sysconf("SC_PAGE_SIZE") * os.sysconf("SC_PHYS_PAGES") / (1024.0**
3)
MEM_GIB = os.sysconf("SC_PAGE_SIZE") * os.sysconf("SC_PHYS_PAGES") / (1024.0**3)

# If set, do extremely granular logging of RPC calls.
LOG_TRACE = bool(os.environ.get('BITCOINPERF_TRACE'))

DEFAULT_NPROC = max(1, int(multiprocessing.cpu_count()) - 1)

Expand Down
6 changes: 2 additions & 4 deletions runner/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"""
Run a series of benchmarks against a particular Bitcoin Core revision(s).
See bin/runlocal.sh for a sample invocation.
"""
import atexit
import os
Expand Down Expand Up @@ -39,7 +37,7 @@

logger = get_logger()

assert sys.version_info >= (3, 8), "Python 3.8 required"
assert sys.version_info >= (3, 8), "Python >=3.8 required"

# Maintain a lockfile that is global across the host to ensure that we're not
# running more than one instance on a given system.
Expand All @@ -64,7 +62,7 @@ def warn(msg):
== 0
):
warn(
"benchmarks shouldn't run concurrently with unrelated bitcoin " "processes"
"benchmarks shouldn't run concurrently with unrelated bitcoin processes"
)

if cfg.safety_checks:
Expand Down

0 comments on commit 0a1d6f5

Please sign in to comment.