internetarchive / internetarchive/openlibrary

Update py-spy to differentiate between archive.org and internal requests

Open
#11,279 1 comment 0 reactions 1 assignee Claimed by @RayBB View on GitHub
Lead: @cdrini Needs: Breakdown Priority: 2 Theme: Monitoring Theme: Performance Type: Feature Request
Dominant language
Python
Stars
6.7k
Forks
2k
Avg merge
2d 19h
Merged PRs (30d)
138

Description

### Feature Request

https://github.com/internetarchive/openlibrary/blob/master/scripts/monitoring/utils.sh#L62-L73

### Problem / Opportunity

```
How to run py-spy: on ol-web[0-2]
docker exec -it openlibrary-monitoring bash
source scripts/monitoring/utils.sh

for pid in $(ps aux | grep -E 'openlibrary-server|coverstore-server' | grep -v 'grep' | awk '{print $2}'); do
echo "$pid $(py_spy_cur_fn $pid)";
done 2>/dev/null \
| awk '{$1=""; print}' \
| awk '{
if ($2 ~ /solr\.py/) print "solr_py";
else if ($1 ~ /^(connect|sleep|wait|getaddrinfo|create_connection|get_availability|get_api_response)$/) print $1;
else print "other"
}' \
| sort \
| uniq -c
```

### Proposal

### Breakdown

### Related files

Refer to [this map of common Endpoints](https://github.com/internetarchive/openlibrary/wiki/Endpoints):
*

### Requirements Checklist
Checklist of requirements that need to be satisfied in order for this issue to be closed:
* [ ]

### Stakeholders

*


### Instructions for Contributors

* **Before** [creating a new branch](https://github.com/internetarchive/openlibrary/wiki/Git-Cheat-Sheet#making-changes-and-creating-a-pull-request) or pushing up changes to a PR, please first [run these commands](https://github.com/internetarchive/openlibrary/wiki/Git-Cheat-Sheet#working-on-your-branch) to ensure your repository is up to date, as the pre-commit bot may add commits to your PRs upstream.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.