github.com/cozy/cozy-stack@v0.0.0-20240603063001-31110fa4cae1/client/tools.go (about) 1 package client 2 3 import ( 4 "io" 5 6 "github.com/cozy/cozy-stack/client/request" 7 ) 8 9 // ProfileHeap returns a sampling of memory allocations as pprof format. 10 func (ac *AdminClient) ProfileHeap() (io.ReadCloser, error) { 11 res, err := ac.Req(&request.Options{ 12 Method: "GET", 13 Path: "/tools/pprof/heap", 14 }) 15 if err != nil { 16 return nil, err 17 } 18 return res.Body, nil 19 }