• Stars
    star
    381
  • Rank 108,941 (Top 3 %)
  • Language
    HTML
  • License
    MIT License
  • Created about 11 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Flamegraph profiling support for Ruby 2.0

Flamegraph

Flamegraph support for arbitrary Ruby apps.

Note, flamegraph support is built in to rack-mini-profiler, just require this gem and you should be good to go. Type ?pp=flamegraph to create one for the current page.

Installation

Add this line to your application's Gemfile:

gem 'flamegraph'

And then execute:

$ bundle

Or install it yourself as:

$ gem install flamegraph

NOTE: For ruby 2.1+ you'll need to install a stackprof gem:

$ gem install stackprof

Usage

Note: Only supported on Ruby 2.0. Gathering stack traces is too slow on earlier versions of Ruby or JRuby

require 'flamegraph'
html = Flamegraph.generate do
  # your work here
end

# or


Flamegraph.generate(filename) do
  # your work here
end

Demo

Demo of: https://github.com/SamSaffron/flamegraph/blob/master/demo/demo.rb

http://samsaffron.github.io/flamegraph/demo.html

Demo of Discourse startup using: https://github.com/SamSaffron/flamegraph/blob/master/demo/rails_startup.rb

WARNING VERY SLOW, MAY CRASH BROWSER TAB http://samsaffron.github.io/flamegraph/rails-startup.html

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

More Repositories

1

memory_profiler

memory_profiler for ruby
Ruby
1,659
star
2

MiniProfiler

A simple but effective mini-profiler for ASP.NET MVC, ASP.NET and Ruby.
1,051
star
3

fast_blank

Ruby
610
star
4

lru_redux

An efficient optionally thread safe LRU Cache
Ruby
282
star
5

graphite_docker

docker container for graphite
Python
165
star
6

redismux

A simple redis multiplexer
Go
54
star
7

allocator_bench

bench of various memory allocators
Ruby
51
star
8

So-Slow

Stack Overflow creative commons database importer
C#
41
star
9

blog

samsaffron.com blog plugin for Discourse
Ruby
37
star
10

cpu-analyzer

C#
36
star
11

dotfiles

various dotfiles I use
Vim Script
31
star
12

fast_stack

Ruby
19
star
13

react-native-key-pair

Objective-C
19
star
14

performance

my personal playground for various perf stuff
Ruby
12
star
15

tvdb-scraper

Scrapes TV metadata from thetvdb
Ruby
9
star
16

youtube-home

a toy I use to disable youtube requires ubiquity router
Ruby
8
star
17

media-library

.Net library for management of media
C#
7
star
18

DataExplorerPG

DataExplorerPG
C#
6
star
19

discourse-ansible

ansible script for setting up discourse from scratch on ubuntu
Ruby
5
star
20

autotest-shoes-gui

A simple GUI for autotest written in shoes
Ruby
5
star
21

simplestorageengine

A simple storage engine for .Net apps supporting active record
C#
4
star
22

ruby-bench-play

Ruby
4
star
23

Media-Browser

Media Browser Git Fork
C#
4
star
24

logviewer

A simple GUI logviewer for rails and ruby
Ruby
2
star
25

discourse_public_import

A tool to import all public posts on discourse
Ruby
2
star
26

super-ssh

A tiny script that help keep ssh tunnels up, similar to autossh
2
star
27

stacktrace

An extension for Ruby that provides with class and method information in the backtrace
Ruby
1
star
28

discourse-solarized

discourse solarized color scheme
1
star
29

brotli-test

A container to test brotli dynamic compression
HTML
1
star
30

mysqldump-x-restore

Automatically exported from code.google.com/p/mysqldump-x-restore
XSLT
1
star
31

discourse-roboto-theme

roboto theme demo
CSS
1
star
32

discourse-nginx-performance-report

Ruby
1
star
33

discourse-dev-benchmark

Ruby
1
star
34

mini_locale

Ruby
1
star
35

bench_web

quick benchmarking tool for web sites
Ruby
1
star