Coder Social home page Coder Social logo

debugserver's Introduction

debugserver

Note: This repository should be imported as code.cloudfoundry.org/debugserver.

A helper function for running a pre-configured pprof server in go.

Reporting issues and requesting features

Please report all issues and feature requests in cloudfoundry/diego-release.

Endpoints

  • /log-level

Sets the log level of the sink passed to the Runner method. This endpoint expects the request method to be POST or PUT and uses the body of the request as the new log level. For example, curl -X POST --data 'debug' http://host:port/log-level will set the log level to debug.

  • /debug/pprof/cmdline

Responds with the running program's command line, with arguments separated by NUL bytes.

  • /debug/pprof/profile

Responds with the pprof-formatted CPU profile.

  • /debug/pprof/heap

Responds with the pprof-formatted heap profile.

  • /debug/pprof/block

Responds with the pprof-formatted goroutine blocking profile.

  • /debug/pprof/trace?seconds=n

Responds with the pprof-formatted execution trace for n seconds.

  • /debug/pprof/symbol

Looks up the program counters listed in the request, responding with a table mapping program counters to function names.

  • /block-profile-rate

Controls the fraction of goroutine blocking events that are reported in the blocking profile. The profiler aims to sample an average of one blocking event per rate nanoseconds spent blocked. To include every blocking event in the profile, pass rate = 1. To turn off profiling entirely, pass rate <= 0.

  • /debug/pprof/goroutine?debug=2

Responds with the full goroutine stack dump.

  • /debug/pprof/<tracename>

Responds with the trace specified by tracename. See: https://golang.org/pkg/net/http/pprof/#Index

Remote debugging

Assuming port forwarding is enabled on the local machine from port 17017 to the debug server, a program profile can be obtained by running the following command:

go tool pprof -seconds=5 http://localhost:17017/debug/pprof/profile

Please see Profiling Go Programs for further information on how to use the go pprof tool.

License

debugserver is licensed under Apache 2.0.

debugserver's People

Contributors

asifdxtreme avatar atulkc avatar emalm avatar heyjcollins avatar jfmyers9 avatar jvshahid avatar krishicks avatar luan avatar lwoydziak avatar mariash avatar milkotodorov avatar nimakaviani avatar sunjaybhatia avatar vito avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.