webmetrics / browsermob-proxy

NOTICE: this project has been forked and is being maintained at https://github.com/lightbody/browsermob-proxy
https://github.com/lightbody/browsermob-proxy
Apache License 2.0
232 stars 763 forks source link

Method of shutting down browsermob-proxy when started from the command line #117

Closed Qarj closed 11 years ago

Qarj commented 11 years ago

I couldn't see in the documentation a way of shutting down browsermob-proxy when I start it by calling the batch script.

For example, it is possible to shutdown Selenium Server by a GET to: http://localhost:%port%/selenium-server/driver/?cmd=shutDownSeleniumServer

If there is an equivalent, can it please be documented, or if not, a method added.

Thanks!

lightbody commented 11 years ago

Tim, Can you explain your use case a bit more? I designed BMP to typically be something that stays running as a daemon process for a long period of time. Individual proxies can be created and deleted with POST and DELETE calls to /proxy, with an individual proxy mapping to a running browser. I'm interested in how you'd prefer to try to use it.

Patrick

On Jun 21, 2013, at 6:48 AM, Tim Buckland notifications@github.com wrote:

I couldn't see in the documentation a way of shutting down browsermob-proxy when I start it by calling the batch script.

For example, it is possible to shutdown Selenium Server by a GET to: http://localhost:%port%/selenium-server/driver/?cmd=shutDownSeleniumServer

If there is an equivalent, can it please be documented, or if not, a method added.

Thanks!

— Reply to this email directly or view it on GitHub.

Qarj commented 11 years ago

Hi Patrick,

Our existing model of automated testing is to spin up all the services we need at the start then tear them down at the end so that nothing is left running. We run a lot of automation in parallel, so we detect free ports at the start of the script and just use those. Perhaps a bit wasteful, but it is clean and potentially allows us to be running different versions of the same tool. This makes upgrading easier since you don’t have to upgrade all your automated tests at the same time if there is some kind of change in the API.

However I’ve changed it to the model you suggest for BMP – the script detects if it is not running and just spins it up if it isn’t. It seems to be working fine.

We are using Windows – I’ve found that if we start the proxy with WMIC we can capture the process id reliably, so we can kill BMP if we need to. So from my point of view this issue is no longer an issue for us.

So just FYI on how we are using BMP at the moment … I’ve setup BMP to whitelist a random URL and return 200 for everything else. When we spin up ChromeDriver.exe, we specify BMP through a PAC file that redirects all third part traffic to the proxy, but lets the main website traffic through directly. Unfortunately though I’ve found that we have some weird dependencies on third parties like adtech and site catalyst for a couple of links and buttons, so I’ve had to re-enable those for now, but obviously we should fix it.

Thanks for looking at my issue. We are still evaluating BMP, however I think we will probably be integrating into our GUI automation suite since it makes our tests run 2x to 3x quicker!

Best Regards,

Tim

From: Patrick Lightbody [mailto:notifications@github.com] Sent: 02 July 2013 06:19 To: webmetrics/browsermob-proxy Cc: Buckland,Tim Subject: Re: [browsermob-proxy] Method of shutting down browsermob-proxy when started from the command line (#117)

Tim, Can you explain your use case a bit more? I designed BMP to typically be something that stays running as a daemon process for a long period of time. Individual proxies can be created and deleted with POST and DELETE calls to /proxy, with an individual proxy mapping to a running browser. I'm interested in how you'd prefer to try to use it.

Patrick

On Jun 21, 2013, at 6:48 AM, Tim Buckland notifications@github.com<mailto:notifications@github.com> wrote:

I couldn't see in the documentation a way of shutting down browsermob-proxy when I start it by calling the batch script.

For example, it is possible to shutdown Selenium Server by a GET to: http://localhost:%port%/selenium-server/driver/?cmd=shutDownSeleniumServerhttp://localhost:%25port%25/selenium-server/driver/?cmd=shutDownSeleniumServer

If there is an equivalent, can it please be documented, or if not, a method added.

Thanks!

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/webmetrics/browsermob-proxy/issues/117#issuecomment-20327049.


Disclaimer

This message is intended only for the use of the person(s) ("Intended Recipient") to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any dissemination, distribution, copying or other use of this message or any of its content by any person other than the Intended Recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are not the Intended Recipient, please contact the sender as soon as possible.

Totaljobs Group Limited Registered Office: Holden House, 57 Rathbone Place, London, W1T 1JU, UK Registered in England and Wales under company no. 4269861


lightbody commented 11 years ago

Cool, thanks for sharing. Closing the issue for now, but feel free to re-open at http://github.com/lightbody/browsermob-proxy (new fork I'm managing) in the future or just kick of a thread on the mailing list if it's more of a conversation like this. Thanks!

gmcdev commented 5 years ago

Is there an answer to this? We also are finding it necessary to stop-and-start BMP for a long-running, multi-threaded test application.

We are experimenting with this, due to a slow memory leak that eventually takes down the server. We aren't 100% certain that it's BMP or JVM, in fact, surely it must not be! But...when we kill off both processes, we are able to sustain our memory footprint much longer :/