FlameScope is a visualization tool for exploring different time ranges as Flame Graphs.
Clone or download
Permalink
Failed to load latest commit information.
app task: upgrading d3-heatmap2 dependency Oct 23, 2018
docs update screenshot Mar 30, 2018
examples repair whitespace in test profile Apr 4, 2018
semantic Import semantic-ui transition less Apr 25, 2018
src task: upgrading d3-heatmap2 dependency Oct 23, 2018
tests Add pytest for basic python tests Apr 6, 2018
.babelrc Initial commit. Nuke git history for GitHub push. Mar 30, 2018
.editorconfig Initial commit. Nuke git history for GitHub push. Mar 30, 2018
.eslintrc.js Initial commit. Nuke git history for GitHub push. Mar 30, 2018
.flake8 Add flake8 and fix discovered issues Apr 6, 2018
.gitignore Add pytest for basic python tests Apr 6, 2018
.travis.yml Add pytest for basic python tests Apr 6, 2018
CHANGELOG Initial commit. Nuke git history for GitHub push. Mar 30, 2018
Dockerfile task: switch dockerfile to alpine and copy instead of git checkout Apr 6, 2018
LICENSE Initial commit. Nuke git history for GitHub push. Mar 30, 2018
OSSMETADATA Initial commit. Nuke git history for GitHub push. Mar 30, 2018
README.md Add a note about c++filt Apr 18, 2018
package-lock.json task: upgrading d3-heatmap2 dependency Oct 23, 2018
package.json task: bumping version Oct 23, 2018
requirements.txt Initial commit. Nuke git history for GitHub push. Mar 30, 2018
run.py Initial commit. Nuke git history for GitHub push. Mar 30, 2018
test-requirements.txt Add pytest for basic python tests Apr 6, 2018
webpack.config.js task: building in production mode Apr 12, 2018
yarn.lock minor clean up by adding updateSearchQuery method Jul 2, 2018

README.md

FlameScope

FlameScope

Gitter TravisCI NetflixOSS Lifecycle License

FlameScope is a visualization tool for exploring different time ranges as Flame Graphs, allowing quick analysis of performance issues such as perturbations, variance, single-threaded execution, and more.

FlameScope begins by displaying the input data as an interactive subsecond-offset heat map. This shows patterns in the data. You can then select a time range to highlight on different patterns, and a flame graph will be generated just for that time range.

Disclaimer

FlameScope is in early stages of development and under constant change, so bugs and issues are expected. We count on your support to find and report them!

Installation / Instructions

The quickest way to get started is to run the pre-built client bundle:

$ git clone https://github.com/Netflix/flamescope
$ cd flamescope
$ pip install -r requirements.txt
$ python run.py

Then browse to http://127.0.0.1:5000/, and you can begin exploring profiles from the examples directory. You can add new profiles to that directory, collected using Linux perf. Here are instructions for a generic CPU profile at 49 Hertz for 120 seconds:

$ sudo perf record -F 49 -a -g -- sleep 120
$ sudo perf script --header > stacks.myproductionapp.2018-03-30_01
$ gzip stacks.myproductionapp.2018-03-30_01	# optional

If you are profiling C++ code, you may want to pipe stacks through c++filt to get readable frames.

There are extra steps to fetch stacks correctly for some runtimes, depending on the runtime. For example, we've previously published Java steps in Java in Flames: java needs to be running with the -XX:+PreserveFramePointer option, and perf-map-agent must be run immediately after the perf record to dump a JIT symbol table in /tmp.

FlameScope can visualize any Linux perf script output that includes stack traces, including page faults, context switches, and other events. See the References section below for documentation.

FlameScope is composed of two main components, the Python backend, and a React client interface. A pre-built client bundle is distributed with the backend, so the quickest way to get started is to install the Python requirements and start the application, as described earlier.

Although not necessary, we strongly suggest using virtualenv to isolate your Python environment.

By default, FlameScope will load a list of files from the examples directory, which includes a two profile examples.

Configuration Options

FlameScope configuration file can be found in app/config.py.

DEBUG = True # run the web server in debug mode
STACK_DIR = 'examples' # path where flamescope will look for profiles
HOST = '127.0.0.1' # web server host
PORT = 5000 # web server port
JSONIFY_PRETTYPRINT_REGULAR = False # pretty print api json responses

Building Client from Source

In order to build the client application from source, the following command line tools must be installed:

Once those tools are available, you will be able to install the project dependencies and generate a build.

$ yarn install
$ npm run webpack

The npm run webpack command will generate a new build under app/public. This directory is exposed by the Python web server.

Webpack can also watch and recompile files whenever they change. To build and start the watch task, run the following command:

$ npm run webpack-watch

Building a Docker Image

FlameScope provides a Dockerfile to build a Docker image:

$ cd flamescope
$ docker build -t flamescope .

The container expects the profiles to be bind-mounted into /stacks and listens on port 5000. To view profiles from /tmp/stacks, start the container with the following command:

$ docker run --rm -it -v /tmp/stacks:/stacks:ro -p 5000:5000 flamescope

Then access FlameScope on http://127.0.0.1:5000

References