# run server using docker
docker run -it -p 4040:4040 pyroscope/pyroscope:latest server
And here's the example on how to use the client library/agent (modifying Go's source code, just like in DataDog or any other APM tools) and install the Pyroscope CLI to run Ruby/Python scripts:
# golang, add agent inside the source code
And here's the example on how to use the client library/agent (modifying Go's source code, just like in DataDog or any other APM tools) and install the Pyroscope CLI to run Ruby/Python scripts:
# golang, add agent inside the source code
import "github.com/pyroscope-io/pyroscope/pkg/agent/profiler"
func main() {
profiler.Start(profiler.Config{
ApplicationName: "my.app.server",
ServerAddress: "http://pyroscope:4040",
})
// rest of your code
}
# ruby or python, install CLI client
cd /tmp
wget https://dl.pyroscope.io/release/pyroscope_0.0.28_amd64.deb
sudo apt-get install ./pyroscope_0.0.28_amd64.deb
# ruby
pyroscope exec ruby yourcode.rb
# python
pyroscope exec python yourcode.py
It would show something like this if you open the server URL (localhost:4040) in the browser, so you can check which part of the code that took most of the runtime.
No comments :
Post a Comment
THINK: is it True? is it Helpful? is it Inspiring? is it Necessary? is it Kind?