A better way to debug Redis Lua scripts

84 views
Skip to first unread message

sil...@gmail.com

unread,
Jul 28, 2015, 2:27:27 AM7/28/15
to Redis DB
Hi

For the past few days I've been struggling with debugging some new scripts and after some googling I came up with a following Lua module (based on following blog post). I've tried to replicate Redis environment as closely as possible but can't find 'redis.sha1hex' as dependency. This module works fine for me, but I would love some feedback on how close does it match what Redis would provide.

Best
Swav

Jan-Erik Rediger

unread,
Jul 28, 2015, 5:45:14 AM7/28/15
to redi...@googlegroups.com
`redis.sha1hex` is provided by using the internal C method `sha1hex`,
that Redis already has.
For an in-Redis-debugging there's also redis-lua-debugger[1].

[1]: https://github.com/redislabs/redis-lua-debugger

On Fri, Jul 24, 2015 at 02:45:29PM -0700, sil...@gmail.com wrote:
> Hi
>
> For the past few days I've been struggling with debugging some new scripts
> and after some googling I came up with a following Lua module
> <https://gist.github.com/silvpol/9d41590eb079a38e509a> (based on following
> blog post
> <http://blog.dimitrioskouzisloukas.com/2014/05/debugging-redis-lua-using-cmsgpack-and.html>).
> I've tried to replicate Redis environment as closely as possible but can't
> find 'redis.sha1hex' as dependency. This module works fine for me, but I
> would love some feedback on how close does it match what Redis would
> provide.
>
> Best
> Swav
>
> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
> To post to this group, send email to redi...@googlegroups.com.
> Visit this group at http://groups.google.com/group/redis-db.
> For more options, visit https://groups.google.com/d/optout.

sil...@gmail.com

unread,
Jul 29, 2015, 2:07:05 PM7/29/15
to Redis DB, jan...@fnordig.de
Hi

That debugger is non-interactive, the script I've linked allows to step debug through your own scripts in LDT (Lua Development Tools) whithout modifying them.
Sorry for the newbie question, but that lib only provides one function - redis.sha1hex("some string"), so I should be able to replace it with any Lua implementation, correct?

Best
Swav

Jan-Erik Rediger

unread,
Jul 29, 2015, 2:17:39 PM7/29/15
to Redis DB
Yip, that should be possible.

On Wed, Jul 29, 2015 at 11:07:05AM -0700, sil...@gmail.com wrote:
> Hi
>
> That debugger is non-interactive, the script I've linked allows to step
> debug through your own scripts in LDT (Lua Development Tools) whithout
> modifying them.
> Sorry for the newbie question, but that lib only provides one function -
> redis.sha1hex("some string"), so I should be able to replace it with any
> Lua implementation, correct?
>
> Best
> Swav
>
> On Tuesday, July 28, 2015 at 10:45:14 AM UTC+1, janerik wrote:
> >
> > `redis.sha1hex` is provided by using the internal C method `sha1hex`,
> > that Redis already has.
> > For an in-Redis-debugging there's also redis-lua-debugger[1].
> >
> > [1]: https://github.com/redislabs/redis-lua-debugger
> >
> > On Fri, Jul 24, 2015 at 02:45:29PM -0700, sil...@gmail.com <javascript:>
> > wrote:
> > > Hi
> > >
> > > For the past few days I've been struggling with debugging some new
> > scripts
> > > and after some googling I came up with a following Lua module
> > > <https://gist.github.com/silvpol/9d41590eb079a38e509a> (based on
> > following
> > > blog post
> > > <
> > http://blog.dimitrioskouzisloukas.com/2014/05/debugging-redis-lua-using-cmsgpack-and.html>).
> >
> > > I've tried to replicate Redis environment as closely as possible but
> > can't
> > > find 'redis.sha1hex' as dependency. This module works fine for me, but I
> > > would love some feedback on how close does it match what Redis would
> > > provide.
> > >
> > > Best
> > > Swav
> > >
> > > --
> > > You received this message because you are subscribed to the Google
> > Groups "Redis DB" group.
> > > To unsubscribe from this group and stop receiving emails from it, send
> > an email to redis-db+u...@googlegroups.com <javascript:>.
> > > To post to this group, send email to redi...@googlegroups.com
> > <javascript:>.
Reply all
Reply to author
Forward
0 new messages