Sha256: ea942b3057860b9bb32f968d50a4e4fc953b7a08cf01a478fdaff81d606a48b2

Contents?: true

Size: 800 Bytes

Versions: 1

Compression:

Stored size: 800 Bytes

Contents

# Stackviz

Quickly open graph image generated by [stackprof](https://github.com/tmm1/stackprof).  
This gem is a thin wrapper of stackprof and provides simple API to see profiling result quickly.

## Installation

```bash
$ brew install graphviz
$ gem install stackviz
```

## Usage

```ruby
require 'stackviz'

Stackviz.profile do
  1000.times { User.all.to_a }
end
```

Stackviz converts profiling result to image by `graphviz`, saves it to `/tmp` directory and `open` it.

![](http://i.gyazo.com/9d57fc063b27aa9748fca559c8499937.png)

### Specify path to save graph

```ruby
Stackviz.profile(path: 'graph.gif') do
  1000.times { User.all.to_a }
end
```

### Do not open graph automatically

```ruby
Stackviz.profile(open: false) do
  1000.times { User.all.to_a }
end
```

## License

MIT License

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stackviz-0.0.2 README.md