Hi, I want to check the processing time of my nginx Lua code. But Lua doesn't support milliseconds. Is there a way to check the response time. Thanks
Nginx certainly supports milliseconds precision, and so does OpenResty. See: https://github.com/openresty/lua-nginx-module#ngxnow https://github.com/openresty/lua-nginx-module#ngxupdate_time Don't forget to call ngx.update_time() if your Lua code is not yielding in between two ngx.now() calls. Secondly, many Nginx variables expose various underlying timing metrics: http://nginx.org/en/docs/varindex.html You can read them in Lua via the ngx.var.VARIABLE API (https://github.com/openresty/lua-nginx-module#ngxvarvariable). Finally, there also exist many systemtap scripts developed by OpenResty to help you measure the performance of your Lua code in other meaningful manners: https://github.com/openresty/stapxx Note that as of today, some of these scripts may not work with the latest OpenResty releases (contributions welcome). Best, Thibault
Thanks. I will check this out