FEATURE: Use speedscope to display flamegraphs and switch from the flamegraph gem to stackprof (#475)

FEATURE: Use speedscope to display flamegraphs and switch from the flamegraph gem to stackprof (#475)

Mini Profiler now ships with an embedded copy of speedscope which provides a very nice experience for viewing flamegraphs.

Flamegraph has been replaced with the stackprof gem. It’s an optional dependency, so if you use the flamegraphs feature, you’ll need to add the stackprof gem to your Gemfile and require it. If you don’t use the feature, you don’t need to add anything and Mini Profiler will work just fine.

diff --git a/README.md b/README.md
index 691af90..23945cb 100644
--- a/README.md
+++ b/README.md
@@ -41,7 +41,6 @@ You can also include optional libraries to enable additional features.
 gem 'memory_profiler'
 
 # For call-stack profiling flamegraphs
-gem 'flamegraph'
 gem 'stackprof'
 `‍``
 
@@ -159,7 +158,7 @@ export RACK_MINI_PROFILER_PATCH="false"
 
 To generate [flamegraphs](http://samsaffron.com/archive/2013/03/19/flame-graphs-in-ruby-miniprofiler):
 
-* add the [**flamegraph**](https://github.com/SamSaffron/flamegraph) gem to your Gemfile
+* add the [**stackprof**](https://rubygems.org/gems/stackprof) gem to your Gemfile
 * visit a page in your app with `?pp=flamegraph`
 
 ### Memory Profiling
diff --git a/lib/html/speedscope/LICENSE b/lib/html/speedscope/LICENSE
new file mode 100644
index 0000000..baf3e9d
--- /dev/null
+++ b/lib/html/speedscope/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 Jamie Wong
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/lib/html/speedscope/README.md b/lib/html/speedscope/README.md
new file mode 100644
index 0000000..1465665
--- /dev/null
+++ b/lib/html/speedscope/README.md
@@ -0,0 +1,3 @@
+This directory contains the necessary files and assets to run [speedscope](https://github.com/jlfwong/speedscope). If you wish to update speedscope to a new version, head over to the [releases](https://github.com/jlfwong/speedscope/releases) page on Github, download the `.zip` file of the release you want to upgrade to and unzip it right here inside this directory. Be sure to delete the `perf-vertx-stacks-01-collapsed-all.*.txt` and `README` files that are in the `.zip` file after you unzip it.
+
+We're currently on version 1.12.1 of speedscope.
diff --git a/lib/html/speedscope/demangle-cpp.1768f4cc.js b/lib/html/speedscope/demangle-cpp.1768f4cc.js
new file mode 100644
index 0000000..282dbd0
--- /dev/null
+++ b/lib/html/speedscope/demangle-cpp.1768f4cc.js
@@ -0,0 +1,4 @@
+parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"bS28":[function(require,module,exports) {

[... diff too long, it was truncated ...]

GitHub sha: cc78c69e

1 Like

This commit appears in #475 which was merged by SamSaffron.