Skip to content
Mobster is a tool that can help you get deeper understanding into the performance of mobile web applications on real mobile devices
Python JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
bin
src
test
.gitignore completed switch to using sendw() when possible
LICENSE
NOTICE
README.md
requirements.txt

README.md

Mobster

Mobster is a tool that can help you get deeper understanding into the performance of web applications on mobile devices and desktop.

It is built off of the WebKit remote debugging protocol and can leverage real devices to extract data that can help you to measure and improve your mobile performance. Below are key features of Mobster.

Highlights :

  • Non-intrusive performance profiling of mobile web apps
  • Automatically detect regressions in page performance and memory usage
  • Insights into native browser events
  • Continuous integration with release process

Mobster provides a simple way for developers to record crucial web performance data on mobile devices while running automated flows. Using Mobster, developers can test the performance of their site on a variety of devices and easily detect any performance regressions. You can gather following metrics from real devices using Mobster:

  • Page timings, network resource sizes and timings
  • Internal browser / DOM events like GC, paints, and CSS recalculates
  • HTTP waterfalls
  • Memory Utilization

Getting Started

Prerequisites

  1. Check out Mobster code:

    git clone https://github.com/linkedin/mobster.git
  2. If you haven't already, install Python. You will need Python 2.6.6 or newer (but not Python 3).

    To find the version of Python installed:

    python --version
  3. Install PIP.

  4. Install the necessary Python libraries using PIP.

    cd mobster; pip install -r requirements.txt

Android-Specific Prerequisites

  1. You must have an Android device with Chrome installed. This will require Android 4.0 ICS or newer. Make sure you are running a recent version of the Chrome app.

  2. Install the Android SDK with packages corresponding to the version of Android your device is running.

  3. Enable USB debugging on the device (Settings -> Developer Options -> USB Debugging, see your device manual for details)

  4. In the Chrome settings, enable USB Debugging (Advanced -> Developer Tools -> Enable USB Web Debugging)

Run Mobster with an Android Device

  1. Execute the command below under the Android SDK folder:

    ./<Android-SDK-Folder>/platform-tools/adb forward tcp:9222 localabstract:chrome_devtools_remote
    
  2. Open Chrome on the device if it isn't already open. Note that Mobster will clear cookies and other browsing data. The tab currently being viewed will be used by Mobster to navigate to webpages.

  3. Run the main Mobster script with a sample flow in your Mobster home directory. This step is the same whether you are running Mobster with an Android device or desktop browser.

    ./bin/mobster.py -t bin/sampleinput/sample.json -p -b

    Mobster reports will be generated in the MOBSTER_HOME/report folder if no folder is specified. Run mobster.py with the "-h" option to learn more about command-line options. To learn how to make your own flows, look at the scripts in the bin/sampleinput/ directory.

Run Mobster with Desktop Chrome

  1. Close all Chrome windows. Then, start desktop Chrome with remote debugging enabled and remote debugging port set to 9222:

    Mac OS:

     open -a "Google Chrome" --args --remote-debugging-port=9222 --enable-memory-info

    Red Hat Linux (assuming google-chrome is in your PATH):

     google-chrome --remote-debugging-port=9222 

    Windows (assuming chrome.exe is in your PATH):

     chrome --remote-debugging-port=9222 

    This should open a Chrome browser window. To test if remote debugging is working, navigate to localhost:9222 in your browser and verify that a page is displayed with the title "Inspectable Pages". If not, make sure that no Chrome windows are open and then try this command again.

  2. Run the main Mobster script with a sample flow in your Mobster home directory. This step is the same whether you are running Mobster with an Android device or desktop browser.

    ./bin/mobster.py -t bin/sampleinput/sample.json -p -b

    Mobster reports will be generated in the MOBSTER_HOME/report folder if no folder is specified. Run mobster.py with the "-h" option to learn more about command-line options. To learn how to make your own flows, look at the scripts in the bin/sampleinput/ directory.

Important Note: If you use Chrome as your web browser normally, it will be annoying to run Mobster with Chrome because Mobster by default uses one of the currently open tab(s) for testing and also clears cookies, etc. This means that, at the end of a test, one of your open tab(s) will be showing the final web page from your test and you will be logged out of all websites. An easy way to avoid this problem is to run Mobster with Chromium or Chrome Canary so your normal browsing is not affected. Chrome, Chromium, and Chrome Canary can all be installed side-by-side.

Contribution

Mobster is a new project, and we are interested in building the community; we would welcome any thoughts or patches. You can reach us on the Apache mailing lists.

The Mobster code is available from git mirror:

git clone https://github.com/linkedin/mobster

Key Components -

  • WebKit Communicator - Handles low-level sending and receiving of messages. Provides a way to specify callbacks
  • Remote WebKit Client - Uses WebKitCommunicator to provide an API for sending commands to the browser and querying for data (e.g. tell the browser to navigate to a URL, get CSS profiling results)
  • FlowProfiler - Interprets the flow file specified by the user and uses WebKitClient's API to perform the actions from the flow, while recording the results
Something went wrong with that request. Please try again.