Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/RedisLabs/redis-lua-debugger
A Redis Lua script for debugging Redis Lua scripts
https://github.com/RedisLabs/redis-lua-debugger
Last synced: 3 months ago
JSON representation
A Redis Lua script for debugging Redis Lua scripts
- Host: GitHub
- URL: https://github.com/RedisLabs/redis-lua-debugger
- Owner: RedisLabs
- License: mit
- Created: 2014-12-31T09:14:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-25T15:41:35.000Z (over 8 years ago)
- Last Synced: 2024-01-16T04:55:34.621Z (5 months ago)
- Language: Lua
- Size: 141 KB
- Stars: 87
- Watchers: 14
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
Lists
- awesome-redis - redis-lua-debugger - A Redis Lua script for debugging Redis Lua scripts (Debugging or Profiling)
README
redis-lua-debugger
==================
rld is a non-interactive debugger for Lua scripts running in Redis. See [this post](https://redislabs.com/blog/pop-the-red-boxs-lid-redis-lua-debugger) for a runtime example.rld's features include:
- Easy & native installation, only ~6KB payload.
- Prints output to local and remote consoles.
- Traces the execution of code lines.
- State-of-the-art automatic watch mechanism reports new variables and value changes.
- Reports function calls, returns and arguments and does on-the-fly profiling.Basic usage
-----------
1. Load rld.lua to Redis once (e.g. `redis-cli --eval rld.lua`).
2. Add this line at the beginning of your Lua script: `rld.start()`.
3. Run your code as usual (e.g. `redis-cli --eval prog.lua`).
4. View rld's output in Redis' log file or by subscribing to the `rld` channel.API
---
- `rld.start()` - starts the debugger
- `rld.stop()` - stops the debugger
- `rld.troff()` / `rld.tron()` - toggles tracing off/on
- `rld.options` - debugger options, see source for detailsTODO
----
- Instead of auto-watch, watch explicit variables by regex (i.e. default is `.*`)
- Publish to different channels according to topic (trace, variables,...)
- Add options arguments to start()Known Issues
------------
- This script is not compatible with Redis v3 and above (https://github.com/antirez/redis/commit/30278061cc834b4073b004cb1a2bfb0f195734f7)
- Last line of user script doesn't trigger auto-watch change printouts
- Function names are shown without global context (e.g. `redis.call` becomes `call`)
- rld functions are also traced (e.g. calling rld.stop/troff/tron from @user_script)
- Replication breaker: while the rld script is replicated, it is never run on the slave explicitly and therefore doesn't register in _G. This causes user scripts to break in the slave when trying to invoke rld.Contributing
------------
1. Fork it.
2. Change it.
3. Make a pull request.
License
-------
See the `LICENSE` file.DISCLAIMER
----------
This script is highly experimental - use at your own risk! (and never in production ;))