I have a small Lua script to run in Redis, and I am interested in getting the runtime.
Due to the nature of Redis and its Lua implementation, I cannot use the TIME function at the script's start / return points and include this information in the opposite for processing (see http://redis.io/commands/eval - Scripts as pure functions). This leads to the error: (error) ERR Error running script (call to f_a49ed2fea72f1f529843d6024d1515e76e69bcbd): Write commands not allowed after non deterministic commands
I was looking for a function for a function / call that I could do that would return the execution time of the last run of the script, but nothing was found yet.
I am using PHP and the Predis Library. Although I can check the runtime on the part of PHP, I want to remove the transfer overhead and find out how long the Lua script will block access to the database. I have successfully returned the time if I do not need to change any data stored in Redis, and that was about 1/10 time when PHP reports.
How to determine the runtime of a Lua script in Redis, and not through PHP?
Pete c
source share