Skip to content

Commit

Permalink
feat: fixing script to also run on macOS, adding README to future new…
Browse files Browse the repository at this point in the history
…comers
  • Loading branch information
afa7789 authored and cffls committed Nov 7, 2024
1 parent 2a0648a commit fda8a41
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/scripts/cpu_monitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ get_process_cpu() {
# Use top in batch mode for each PID to get current CPU usage
for pid in $pids; do
# Get process command
cmd=$(ps -p $pid -o cmd=)
if [[ "$OSTYPE" == "darwin"* ]]; then
cmd=$(ps -p $pid -o command=)
cpu=$(top -l 1 -pid $pid | tail -1 | awk '{print $3}')
else
cmd=$(ps -p $pid -o cmd=)
cpu=$(top -b -n 1 -p $pid | tail -1 | awk '{print $9}')
fi
# Get current CPU usage
cpu=$(top -b -n 1 -p $pid | tail -1 | awk '{print $9}')
echo "$pid $cpu $cmd" >> "$DETAILED_LOG"
done
fi
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,15 @@ Useful config entries:
- `zkevm.sync-limit`: This will ensure the network only syncs to a given block height.
- `debug.timers`: This will enable debug timers in the logs to help with performance tuning. Recording timings of witness generation, etc. at INFO level.

Metrics and pprof configuration flags:

- `metrics:` Enables or disables the metrics collection. Set to true to enable.
- `metrics.addr`: The address on which the metrics server will listen. Default is "0.0.0.0".
- `metrics.port`: The port on which the metrics server will listen. Default is 6060.
- `pprof`: Enables or disables the pprof profiling. Set to true to enable.
- `pprof.addr`: The address on which the pprof server will listen. Default is "0.0.0.0".
- `pprof.port`: The port on which the pprof server will listen. Default is 6061.

***


Expand Down

0 comments on commit fda8a41

Please sign in to comment.