Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/takikawa/racket-profile-flamegraph

Hooks up Racket profile outputs to FlameGraph
https://github.com/takikawa/racket-profile-flamegraph

racket

Last synced: 5 days ago
JSON representation

Hooks up Racket profile outputs to FlameGraph

Awesome Lists containing this project

README

        

# profile-flame-graph

[![Scribble](https://img.shields.io/badge/Docs-Scribble-blue.svg)](http://docs.racket-lang.org/profile-flame-graph/index.html)

A library for providing Racket profiler outputs as
[flame graphs](https://github.com/brendangregg/FlameGraph).

The library can optionally call out to the `flamegraph.pl` script.
For this feature, you will need to check out the
[FlameGraph](https://github.com/brendangregg/FlameGraph) repo and
add it to your `PATH` variable.

# Quick usage

Install with:

```
raco pkg install profile-flame-graph
```

You will need to install FlameGraph. On a unix system, that might
look like this:

```
git clone https://github.com/brendangregg/FlameGraph.git
export PATH="$PATH:$PWD/FlameGraph"
```

Add this import into the program you want to profile:

```
(require profile-flame-graph)
```

Wrap the expression you want to profile in your program like this:

```racket
(profile
#:svg-path "my-profile.svg"
#:preview? #t)
```

and run your program:

```
racket .rkt
```

which will write the profile output to `my-profile.svg` and pop
up a window showing the flame graph.

---

Copyright © 2016 Asumu Takikawa

This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option) any
later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program. If not, see http://www.gnu.org/licenses.