Performance Viewer works with several profile formats. Everything is processed locally in your browser — no data is uploaded.
| Format | Language | Features |
|---|---|---|
Vernier .vernier.json | Ruby | Full Stack chart, SQL queries, N+1 detection, GC, feature flags, markers |
StackProf .json | Ruby | Partial Stack chart, hotspots, lifecycle (no SQL/marker data) |
Folded Stacks .txt | Any | Partial Stack chart, hotspots (Go, perf, dtrace, etc.) |
Vernier is a modern Ruby profiler that captures CPU time, SQL queries, GC pauses, feature flags, and more.
gem install vernier
# or add to your Gemfile:
gem "vernier", group: :development
# Profile a block of code
Vernier.profile(out: "my_profile.vernier.json") do
# your code here
end
# Profile a Rails request (add to a controller):
# GET /posts?flamegraph=1
around_action :vernier_profile, if: -> { params[:flamegraph] }
def vernier_profile
Vernier.profile(out: "request.vernier.json") { yield }
end
# Profile any Ruby script
vernier run -- ruby my_script.rb
# Profile with allocation tracking
vernier run --allocation-interval 1 -- ruby my_script.rb
# Profile a Rails server request
vernier run -- rails runner "MyModel.expensive_query"
Drop the .vernier.json file onto the Performance Viewer to see the full analysis.
gem install stackprof
# Profile a block
StackProf.run(mode: :wall, raw: true, out: "stackprof.json") do
# your code here
end
# IMPORTANT: use raw: true for flamegraph data
Export a Go CPU profile as folded stacks:
# Generate a CPU profile
go test -cpuprofile cpu.prof ./...
# Convert to folded stacks format
go tool pprof -raw cpu.prof > profile.txt
# Or use stackcollapse-go.pl from Brendan Gregg's tools:
go tool pprof -raw cpu.prof | stackcollapse-go.pl > profile.folded
# Record a profile
perf record -g -p PID sleep 30
# Convert to folded stacks
perf script | stackcollapse-perf.pl > profile.folded
Any profiler that can output the Brendan Gregg folded stack format works:
# Format: semicolon-separated stack followed by a count
main;handleRequest;db.Query 150
main;handleRequest;json.Marshal 80
main;handleRequest;template.Execute 60