I have a small Lua script to run in Redis, and I'm interested in getting the execution time.
Due to the nature of Redis and it's Lua implementation, I cannot use the TIME function at the start/return points of the script, and include this information in the return for processing (See http://redis.io/commands/eval - Scripts as pure functions). This results in an error: (error) ERR Error running script (call to f_a49ed2fea72f1f529843d6024d1515e76e69bcbd): Write commands not allowed after non deterministic commands
I have searched around for a function/call I could make which will return the execution time of the last run script, but have not found anything yet.
I am using PHP and the Predis Library. While I can check the execution time from PHP side, I wish to remove the transmission overhead and find out how long the Lua script will block access to the database. I have successfully had times returned if I do not need to alter any of the data stored in Redis, and these have been about 1/10th the time PHP reports.
How can I determine the execution time of the Lua script in Redis, and not via PHP?
os.clock()in a script, and I'm getting an error back sayingScript attempted to access unexisting global variable 'os'. Looks like this is unavailable. Thanks anyway!