File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 11# Note: The code in here is tested by scripts/monitoring/tests/test_utils_sh.py
22
3+ find_worker_pids () {
4+ ps aux | grep -E ' openlibrary-server|coverstore-server' | grep -v ' grep' | awk ' {print $2}'
5+ }
6+ export -f find_worker_pids
7+
38py_spy_cur_fn () {
49 pid=$1
510
@@ -12,7 +17,7 @@ py_spy_cur_fn() {
1217
1318 py-spy dump --nonblocking --pid $pid \
1419 | grep -vE ' ^(Process|Python|Thread)' \
15- | grep -vE ' (\bssl\.py|(readinto) .*socket\.py|http/client\.py|sentry_sdk|urllib3/connection\.py|<genexpr>|urllib3/connectionpool\.py|requests/(api|adapters|sessions)\.py)' \
20+ | grep -vE ' (\bssl\.py|(readinto) .*socket\.py|http/client\.py|sentry_sdk|urllib3/connection\.py|<genexpr>|urllib3/connectionpool\.py|requests/(api|adapters|sessions)\.py|httpcore/|httpx/ )' \
1621 | head -n2 | tail -n1
1722}
1823export -f py_spy_cur_fn
@@ -59,7 +64,7 @@ log_workers_cur_fn() {
5964 # related to requests connection pooling
6065 # - get_availability|get_api_response: Main time block for IA requests
6166
62- for pid in $( ps aux | grep -E ' openlibrary-server|coverstore-server ' | grep -v ' grep ' | awk ' {print $2} ' ) ; do
67+ for pid in $( find_worker_pids ) ; do
6368 echo " $pid $( py_spy_cur_fn $pid ) " ;
6469 done 2> /dev/null \
6570 | awk ' {$1=""; print}' \
You can’t perform that action at this time.
0 commit comments