package
0.1.6
Repository: https://github.com/alexjx/gopher-lua-libs.git
Documentation: pkg.go.dev

# README

pprof GoDoc

Usage

local pprof = require("pprof")
local http = require("http")
local time = require("time")

local client = http.client()
local pp = pprof.register(":1234")

pp:enable()
time.sleep(1)

local req, err = http.request("GET", "http://127.0.0.1:1234/debug/pprof/goroutine")
if err then error(err) end
local resp, err = client:do_request(req)
if err then error(err) end
if not(resp.code == 200) then error("resp code") end

pp:disable()
time.sleep(5)

local resp, err = client:do_request(req)
if not(err) then error("must be error") end

# Functions

Disable pprof stop.
Enable start pprof.
Loader is the module loader function.
Preload adds pprof to the given Lua state's package.preload table.
Register(string): return (pprof_ud, err).