Upsun User Documentation

Continuous profiling for Ruby

Try Upsun for 15 days
After that, enjoy the same, game-changing Upsun features for less with the First Project Incentive!ยน A monthly $19 perk!
ยนTerms and conditions apply
Activate your 15-day trial

Upsun Continuous Profiler is powered by Blackfire. It is available directly the Console, under the Profiling tab of your environments.

The Ruby continuous profiling is currently made across 3 dimensions:

  • CPU Time: Time spent running on the CPU
  • Wall-time: elapsed time per function call
  • Allocations: Time spent running on the CPU

The default sampling frequency is 100 Hz. This means the Ruby continuous profiler is collecting information 100 times per second.

Prerequisites Anchor to this heading

Upsun Continuous Profiler requires Ruby >= 2.5.

Installation Anchor to this heading

  1. Add the datadog gem to your Gemfile or gems.rb file:
gem 'datadog', '~> 2.0'
  1. Install the gems running the bundle install command.

  2. Add the ddprofrb exec command to your Ruby application start command:

bundle exec ddprofrb exec ruby myrubyapp.rb

Rails example:

bundle exec ddprofrb exec bin/rails s

Alternatively, start the profiler by adding the following code in your application’s entry point if you can’t start it using ddprofrb exec:

require 'datadog/profiling/preload'

Is this page helpful?