Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Report available system memory under dcc_free_mem #2

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

whisperity
Copy link
Owner

Closes #1.

This patch adds a trivial wrapper HTTP server, written in Python, that intercepts the requests going towards the --stats-port of the running distccd server.
It relays the request verbatim at first, and if the response is a valid statistics message, extends it at the bottom with a line

dcc_free_mem 16384 MB

where the numeric value is obtained from free's output under Available system memory.

@whisperity whisperity added the enhancement New feature or request label Jun 5, 2024
@whisperity whisperity force-pushed the feat/dcc_free_mem branch 9 times, most recently from c9457f8 to 3b0101a Compare June 7, 2024 14:18
Copy link

@vodorok vodorok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

# diagram:
#
# DistCC Docker Container
# ┌───────────────────────────────────────────────────────┐
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the diagram +1:

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🥳 I did it originally with http://asciiflow.com (lewish/asciiflow), as seen in #1. 😉 Then it was edited to fit the 80-col requirements of pycodestyle.

This patch adds a trivial wrapper HTTP server, written in Python, that
intercepts the requests going towards the `--stats-port` of the running
`distccd` server.
It relays the request verbatim at first, and if the response is a valid
statistics message, extends it at the bottom with a line

    dcc_free_mem 16384 MB

where the numeric value is obtained from `free`'s output under
**Available** system memory.
@whisperity whisperity merged commit 1305a02 into master Jun 11, 2024
4 checks passed
@whisperity whisperity deleted the feat/dcc_free_mem branch June 26, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature request] Intercept and patch --stats output from the container to include distcc_free_system_memory
2 participants