<div dir="ltr">Hi,<div><br></div><div>I'm trying to use the lua module in combination with ngx.shared.DICT feature to record some statistics for nginx (and upstreams') health monitoring. <br></div><div><br></div><div>
When I do dict.get_keys(100), I see the following error in nginx error.log:</div><div><br></div><div><div>2014/08/06 06:27:55 [error] 13446#0: *1 lua entry thread aborted: runtime error: /opt/inmobi/nginx/customlua/logging.lua:56: bad argument #1 to 'get_keys' (userdata expected, got number)</div>
<div>stack traceback:</div><div>coroutine 0:</div><div> [C]: in function 'get_keys'</div><div> /opt/inmobi/nginx/customlua/logging.lua:56: in function 'get_all_plots'</div><div> [string "content_by_lua"]:3: in function <[string "content_by_lua"]:1>, client: 127.0.0.1, server: , request: "GET /stat2 HTTP/1.1", host: "localhost"</div>
</div><div><br></div><div>I'm using ngx_openresty version: ngx_openresty/<a href="http://1.2.4.11">1.2.4.11</a><br></div><div><br></div><div><div>Could someone please guide me how to use the get_keys method of the shared dict in nginx/lua? </div>
<div><br></div></div><div>Cheers,</div><div><br></div><div> -Suraj</div><div><br></div><div>[1] Much in the spirit of <a href="http://blog.cloudflare.com/pushing-nginx-to-its-limit-with-lua">http://blog.cloudflare.com/pushing-nginx-to-its-limit-with-lua</a><br clear="all">
<div><br></div>-- <br><div dir="ltr">An Onion is the Onion skin and the Onion under the skin until the Onion Skin without any Onion underneath.<div><br></div></div>
</div></div>
<br>
<div><span style="font-family:Arial;background-color:white">______________________________<WBR>______________________________<WBR>_</span></div><span style="font-family:Arial;background-color:white"><font color="#808080">The information contained in this communication is intended solely for the use of the individual or entity to whom it is addressed and others authorized to receive it. It may contain confidential or legally privileged information. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this communication in error, please notify us immediately by responding to this email and then delete it from your system. The firm is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt.</font></span>