Skip to content

Conversation

@timvaillancourt
Copy link
Contributor

@timvaillancourt timvaillancourt commented Aug 18, 2020

This PR allows Freno to expose the net/http/pprof HTTP API for profiling Golang applications

This is an optional feature enabled by -enable-profiling or EnableProfiling: true in the config file

This allows go tool pprof to be used against Freno, example:

tim@Tims-MacBook-Pro freno % go tool pprof 'http://localhost:8088/debug/pprof/profile?seconds=10'
Fetching profile over HTTP from http://localhost:8088/debug/pprof/profile?seconds=10
Saved profile in /Users/tim/pprof/pprof.samples.cpu.003.pb.gz
Type: cpu
Time: Aug 18, 2020 at 9:23pm (CEST)
Duration: 10s, Total samples = 130ms ( 1.30%)
Entering interactive mode (type "help" for commands, "o" for options)
(pprof) top10
Showing nodes accounting for 130ms, 100% of 130ms total
Showing top 10 nodes out of 24
      flat  flat%   sum%        cum   cum%
      40ms 30.77% 30.77%       40ms 30.77%  runtime.kevent
      40ms 30.77% 61.54%       40ms 30.77%  runtime.nanotime1
      20ms 15.38% 76.92%       20ms 15.38%  runtime.usleep
      10ms  7.69% 84.62%       10ms  7.69%  runtime.pthread_cond_signal
      10ms  7.69% 92.31%       10ms  7.69%  runtime.pthread_cond_timedwait_relative_np
      10ms  7.69%   100%       10ms  7.69%  runtime.read
         0     0%   100%       10ms  7.69%  runtime.checkTimers
         0     0%   100%       70ms 53.85%  runtime.findrunnable
         0     0%   100%       80ms 61.54%  runtime.mcall
         0     0%   100%       50ms 38.46%  runtime.mstart

cc @shlomi-noach / @gtowey

@timvaillancourt timvaillancourt temporarily deployed to staging August 19, 2020 17:19 Inactive
@timvaillancourt timvaillancourt merged commit 1016c68 into master Aug 20, 2020
@timvaillancourt timvaillancourt deleted the enable-profiling branch August 20, 2020 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants