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

Expose os.Process from the Browser #737

Merged
merged 7 commits into from Apr 30, 2021
Merged

Expose os.Process from the Browser #737

merged 7 commits into from Apr 30, 2021

Conversation

msoap
Copy link
Contributor

@msoap msoap commented Jan 13, 2021

Hi,
I've see #566, but we need a pid to control memory for all Chrome processes. We use this to export prometheus metrics with the consumed memory of sessions, for displaying on the Grafana dashboard.

Usage:

chromedp.FromContext(ctx).Browser.Process()

browser.go Outdated Show resolved Hide resolved
Co-authored-by: Dmytro Vovk <dmitry-vovk@users.noreply.github.com>
browser.go Outdated Show resolved Hide resolved
@msoap
Copy link
Contributor Author

msoap commented Feb 10, 2021

@mvdan please take a look

@msoap
Copy link
Contributor Author

msoap commented Feb 17, 2021

@kenshaw maybe you look?

browser.go Outdated Show resolved Hide resolved
@msoap msoap changed the title Expose PID from the Browser Expose os.Process from the Browser Apr 29, 2021
@msoap msoap requested a review from ZekeLu April 29, 2021 17:41
Copy link
Member

@ZekeLu ZekeLu left a comment

Choose a reason for hiding this comment

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

I have added some more comments. Please take a look.
Sorry to quibble but let's try our best to make it better.

browser.go Outdated Show resolved Hide resolved
browser.go Outdated Show resolved Hide resolved
browser.go Outdated Show resolved Hide resolved
browser.go Outdated Show resolved Hide resolved
@msoap msoap requested a review from ZekeLu April 30, 2021 07:34
browser.go Show resolved Hide resolved
browser.go Outdated Show resolved Hide resolved
@msoap msoap requested a review from ZekeLu April 30, 2021 08:14
Copy link
Member

@ZekeLu ZekeLu left a comment

Choose a reason for hiding this comment

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

Hey, @msoap It looks good to me now. Thank you very much!

Hi, @kenshaw Do you have time to take a look?

@kenshaw
Copy link
Member

kenshaw commented Apr 30, 2021

@ZekeLu I'm fine with this. Absolutely no problem exposing lower internals in general.

@ZekeLu
Copy link
Member

ZekeLu commented Apr 30, 2021

Thank you all! I'm going to merge this request.

@ZekeLu ZekeLu merged commit b19d1ad into chromedp:master Apr 30, 2021
@msoap msoap deleted the expose_chrome_pid branch April 30, 2021 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants