google / caliper

Micro-benchmarking library for Java
Apache License 2.0
816 stars 109 forks source link

Moe Sync #393

Closed ronshapiro closed 6 years ago

ronshapiro commented 6 years ago

This code has been reviewed and submitted internally. Feel free to discuss on the PR and we can submit follow-up changes as necessary.

Commits:

Add truth to pom.xml for caliper-util now that it's used in tests there. 4890c36818a7a10bc9c2a6429fb698e450db53e6 -------

Additional changes to proxy-related message classes in the bridge package. 60e6d7bec08aac83eaffd3a90afe9e03dc0e2a23 -------

Start of AdbDevice implementation. The general way this is intended to work: - User provides a worker classpath consisting of a single .apk containing their code as well as the Caliper worker code. Among the Caliper worker code will be CaliperProxyActivity. - The AdbDevice starts up and uses adb (via shell commands) to install the apk to the device, set up reverse port forwarding (allow the device to connect directly to the port the runner listens on as if it were on the same machine) and start CaliperProxyActivity. - CaliperProxyActivity opens a connection on the port back to the runner; AdbDevice recieves the connection. - When asked to start a VM, AdbDevice sends a request over the socket connection to the proxy. The proxy starts the actual process, and opens two new socket connections to the runner. It pipes the process' stdout through one and stderr through the other. AdbDevice receives these connections and uses them to implement VmProcess.stdout() and .stderr(). - CaliperProxyActivity monitors each process it's started and notifies the runner when each completes. It can also receive and handle requests from the runner to kill specific processes it's started. a571316ac33955a0c1246e88565a58f559fef85c -------

Add CaliperProxyActivity, an Android Activity that Caliper can run on a device to help it manage worker processes on that device. Most of the actual work of the proxy is done in CaliperProxy; the Activity is mostly responsible for creating and starting up the CaliperProxy service. da18c941e08343d6e228d5b6a8bb886707dc6e96