{"id":21970813,"url":"https://github.com/kingluo/ngx-lua-request-time","last_synced_at":"2025-04-28T11:28:30.479Z","repository":{"id":154494882,"uuid":"628185995","full_name":"kingluo/ngx-lua-request-time","owner":"kingluo","description":"openresty hook: record the lua execution time per request in ngx.ctx via LD_PRELOAD","archived":false,"fork":false,"pushed_at":"2023-05-12T09:50:38.000Z","size":20,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T09:11:33.640Z","etag":null,"topics":["linker","luajit","nginx","openresty","profiling"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kingluo.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}},"created_at":"2023-04-15T06:55:39.000Z","updated_at":"2025-03-03T06:01:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"fa9c9ddc-955d-425b-b8d4-ba25f6130e77","html_url":"https://github.com/kingluo/ngx-lua-request-time","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingluo%2Fngx-lua-request-time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingluo%2Fngx-lua-request-time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingluo%2Fngx-lua-request-time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingluo%2Fngx-lua-request-time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kingluo","download_url":"https://codeload.github.com/kingluo/ngx-lua-request-time/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251304144,"owners_count":21567822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["linker","luajit","nginx","openresty","profiling"],"created_at":"2024-11-29T14:43:12.450Z","updated_at":"2025-04-28T11:28:30.467Z","avatar_url":"https://github.com/kingluo.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ngx-lua-request-time\n\nIt records the lua execution time per request in `ngx.ctx`, in microsecond.\n\nCheck this blog for details:\n\nhttp://luajit.io/posts/openresty-lua-request-time/\n\nThe request time is the sum of the following metrics:\n\n* `lua_resume`\n  * phases\n    * REWRITE\n    * ACCESS\n    * CONTENT\n    * BALANCER\n* `lua_pcall`\n  * filters\n    * header_filter\n    * body_filter\n\n**It's non-intrusive and zero-cost.**\n\nUsage:\n\n```bash\nNGX_LUA_REQUEST_TIME_VAR_NAME=openresty_request_time_us \\\nLD_PRELOAD=/opt/ngx-lua-request-time/ngx_lua_request_time.so \\\nopenresty -p $PWD -c nginx.conf\n```\n\n* `NGX_LUA_REQUEST_TIME_VAR_NAME`: variable name in `ngx.ctx.\u003cvar\u003e`\n* `LD_PRELOAD`: preload the `ngx_lua_request_time.so`\n\n## build\n\n```bash\nmake\n# output ngx_lua_request_time.so\n```\n\n## demo\n\n*Do not use the Alpine docker image, where the musl libc seems not LD_PRELOAD compatible.*\n\n* [openresty](https://github.com/kingluo/ngx-lua-request-time/tree/main/demo/openresty)\n* [apisix](https://github.com/kingluo/ngx-lua-request-time/tree/main/demo/apisix)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkingluo%2Fngx-lua-request-time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkingluo%2Fngx-lua-request-time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkingluo%2Fngx-lua-request-time/lists"}