Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Lua script execution time
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Marc Gravell  
View profile  
 More options Nov 5 2012, 7:29 am
From: Marc Gravell <marc.grav...@gmail.com>
Date: Mon, 5 Nov 2012 12:28:41 +0000
Local: Mon, Nov 5 2012 7:28 am
Subject: Re: Lua script execution time

OK, this is ***really*** nasty: I **strongly** suggest you don't use this,
because it suggests that PTTL is incorrectly not being flagged as
non-deterministic (unless I'm missing something - Salvatore might be able
to advise more):

redis.call('setex', KEYS[1], 60, 'timing')
for i = 1,100000 do
    redis.call('set', 'ignore','abc')
end
local timeTaken = 60000 - redis.call('pttl', KEYS[1])
redis.call('del', KEYS[1])
return timeTaken

this is **really** ugly; note here that KEYS[1] is just a nasty guid I used
for a scratch key, and `ignore` is just something to make the time
detectable (that isn't meant to be illustrative).

Seriously, don't do this!

I would probably just time it at the client (which includes bandwidth
costs), or issue a TIME before and after the EVAL/EVALSHA (which may
include timings from other connections), and call it "close enough".

But I would consider the fact that the above *works* to be a bug...

Marc

On 5 November 2012 12:17, Yiftach Shoolman <yiftach.shool...@gmail.com>wrote:

> redis-cli --latency -h `host` -p `port`

> More info here <http://redis.io/topics/latency>

> On Mon, Nov 5, 2012 at 2:04 PM, Peter Choo <peterc...@gmail.com> wrote:

>> Due to Redis not allowing write commands after TIME has been called,  How
>> can I benchmark the execution time of a small lua script?

>> Is there a function I can call to ask how long it took to run the last
>> script?  I am not interested in the data transfer time, just how long it
>> took to run in Redis.

>> --
>> You received this message because you are subscribed to the Google Groups
>> "Redis DB" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/redis-db/-/G6XxpMoamdMJ.
>> To post to this group, send email to redis-db@googlegroups.com.
>> To unsubscribe from this group, send email to
>> redis-db+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/redis-db?hl=en.

> --

> Yiftach Shoolman
> +972-54-7634621

>  --
> You received this message because you are subscribed to the Google Groups
> "Redis DB" group.
> To post to this group, send email to redis-db@googlegroups.com.
> To unsubscribe from this group, send email to
> redis-db+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/redis-db?hl=en.

--
Regards,

Marc


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.