Skip to content

Commit

Permalink
Update factory_prof.md
Browse files Browse the repository at this point in the history
  • Loading branch information
uzushino authored and palkan committed Dec 12, 2023
1 parent 4a2bde1 commit 2861592
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,3 +378,4 @@ See [changelog](https://github.com/test-prof/test-prof/blob/v0.8.0/CHANGELOG.md)
[@peret]: https://github.com/peret
[@bf4]: https://github.com/bf4
[@Vankiru]: https://github.com/Vankiru
[@uzushino]: https://github.com/uzushino
19 changes: 19 additions & 0 deletions docs/profilers/factory_prof.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,25 @@ And for every test run see the overall factories usage:
[TEST PROF INFO] Time spent in factories: 04:31.222 (54% of total time)
```

### Exporting profile results to a JSON file

FactoryProf can save profile results as a JSON file.

To use this feature, set the `FPROF` environment variable to `json`:

```sh
FPROF=json rspec

# or
FPROF=json bundle exec rake test
```

Example output:

```
[TEST PROF INFO] Profile results to JSON: tmp/test_prof/test-prof.result.json
```

## Factory Flamegraph

The most useful feature of FactoryProf is the _FactoryFlame_ report. That's the special interpretation of Brendan Gregg's [flame graphs](http://www.brendangregg.com/flamegraphs.html) which allows you to identify _factory cascades_.
Expand Down

0 comments on commit 2861592

Please sign in to comment.