{"id":28085658,"url":"https://github.com/chronolaw/lua-resty-gperftools","last_synced_at":"2026-04-20T03:36:28.747Z","repository":{"id":85209096,"uuid":"138993930","full_name":"chronolaw/lua-resty-gperftools","owner":"chronolaw","description":"Lua API for  ngx_google_perftools_profiler_module","archived":false,"fork":false,"pushed_at":"2018-06-29T02:35:47.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-05T19:14:55.676Z","etag":null,"topics":["lua-resty","nginx","openresty","perftools"],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chronolaw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-06-28T09:05:26.000Z","updated_at":"2019-09-24T09:15:11.000Z","dependencies_parsed_at":"2023-05-17T19:30:33.662Z","dependency_job_id":null,"html_url":"https://github.com/chronolaw/lua-resty-gperftools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chronolaw/lua-resty-gperftools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronolaw%2Flua-resty-gperftools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronolaw%2Flua-resty-gperftools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronolaw%2Flua-resty-gperftools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronolaw%2Flua-resty-gperftools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chronolaw","download_url":"https://codeload.github.com/chronolaw/lua-resty-gperftools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronolaw%2Flua-resty-gperftools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32031886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lua-resty","nginx","openresty","perftools"],"created_at":"2025-05-13T10:40:30.565Z","updated_at":"2026-04-20T03:36:28.739Z","avatar_url":"https://github.com/chronolaw.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lua-resty-gperftools\nLua API for [`ngx_google_perftools_profiler_module`](https://github.com/chronolaw/ngx_google_perftools_profiler_module)\n\nBefore use these tools, you must compile nginx/openresty with \n[`ngx_google_perftools_profiler_module`](https://github.com/chronolaw/ngx_google_perftools_profiler_module)\n\n## Installation\n\nPlease use `opm`, such as :\n\n```lua\nopm get chronolaw/lua-resty-gperftools\n```\n\n## Usage\n\nSome simple examples:\n\n```nginx\n    location /gperftools {\n        content_by_lua_block {\n            local gperftools = require \"resty.gperftools\"\n\n            local profiler = ngx.var.arg_profiler\n            local action = ngx.var.arg_action\n            local name = ngx.var.arg_name\n\n            gperftools[profiler][action](name)\n\n            -- or profiler in 10 seconds\n            -- gperftools[profiler][action](name, 10)\n\n            ngx.say(\"OK\")\n        }\n    }\n```\n\nThen you can start/stop gperftools with `curl` like below:\n\n```shell\n    curl 'http://127.0.0.1/gperftools?profiler=cpu\u0026action=start\u0026name=/tmp/ngx_prof'\n    ...     # ab/http_load/wrk and so on\n    curl 'http://127.0.0.1/gperftools?profiler=cpu\u0026action=stop'\n```\n\n## API\n\n### ok, err = gperftools.cpu.start(name, *during*)\nStart cpu profiler, infomations stores in `name`.\n\nIf `during` is given, the profiler will STOP after `during` seconds.\n\nNotice: It will NOT add pid suffix for the name.\n\n### gperftools.cpu.stop()\nStop cpu profiler.\n\n### gperftools.heap.start(name, *n*, *during*)\nStart heap profiler, infomations stores in `name`, dump for every `n` seconds.\n\nIf `during` is given, the profiler will STOP after `during` seconds.\n\nNotice: It will NOT add pid suffix for the name.\n\n### gperftools.heap.dump(s)\nDump heap profiler infomations, `s` for the reason.\n\n### gperftools.heap.stop()\nStop heap profiler.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchronolaw%2Flua-resty-gperftools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchronolaw%2Flua-resty-gperftools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchronolaw%2Flua-resty-gperftools/lists"}