Skip to content

Instantly share code, notes, and snippets.

@marcotc
Created January 26, 2022 00:13
Show Gist options
  • Save marcotc/880ad3bc4970acd50e1526e825f44877 to your computer and use it in GitHub Desktop.
Save marcotc/880ad3bc4970acd50e1526e825f44877 to your computer and use it in GitHub Desktop.
profiler proposal
module Datadog
module Profiling
# Starts the profiler, if the profiler is supported by in
# this runtime environment and if the profiler has been enabled
# in configuration.
#
# @return [Boolean] `true` if the profiler has successfully started, otherwise `false`.
# @public_api
def self.start
return false unless Datadog.send(:components).profiler
Datadog.send(:components).profiler.start
true
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment