Skip to content

Commit

Permalink
Updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandr Fedotov committed Jun 27, 2017
1 parent a6645ff commit 1aaad5d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
/esc
.idea
server
embed
.idea
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# Lottip

Lottip is proxy for **MySQL RDBMS** with web GUI. It will show you what's happening under the hood of your database layer.
As it sits between your application and MySQL server there's no need to use tools like Wireshark to see which queries are being executed.
As it sits between your application and MySQL server there's no need to use tools like Wireshark or enable general logs to see which queries are being executed.
It comes as single binary with zero dependencies and consists of 2 parts: proxy server and embedded GUI.

# Screenshots
Here's how query list looks like:
![Example 1](https://raw.githubusercontent.com/orderbynull/lottip/master/shots/1.png)
Each query can be expanded for detailed view:
![Example 2](https://raw.githubusercontent.com/orderbynull/lottip/master/shots/2.png)
Bottom query freezed for 10 seconds:
![Example 3](https://raw.githubusercontent.com/orderbynull/lottip/master/shots/3.png)
![Example 1](https://1.downloader.disk.yandex.ru/disk/82afbaa6ce9aad75d933f5b301786370158163a0adc0946bbb1c57586c00048e/5952ccb4/fKqInKw3d7bLFOeFnMGnhIpCh-g1Fsa4ASTpYYM1Tq82SVhYPSUYXiw5SnQjlbcFsWJBAtfosLEWTLDBVSUHpAtqvJgORLVMKQXgkxmqx4ar8npumZHI4midPdWhecNq?uid=0&filename=query-list.png&disposition=inline&hash=&limit=0&content_type=image%2Fpng&fsize=529592&hid=9cf9439e72300a253f78baa1c5ac1b9e&media_type=image&tknv=v2&etag=2b9e9b1c4ab35daec10ad11d196b00f6)
Query freezed for 10 seconds:
![Example 2](https://4.downloader.disk.yandex.ru/disk/836e493fc28cad669e4b9e08f77dbad5ffefcbcb75f12cc82144fb889cb4e1f0/5952cce1/fKqInKw3d7bLFOeFnMGnhPyNSkKL-VufKsCx8zmN0C_LvxSEN1CQimedqoRS48qfyYUGTtS4vgYL-MRO3PJt1i9iIgiAuomYMwlRghktoIer8npumZHI4midPdWhecNq?uid=0&filename=sleep.png&disposition=inline&hash=&limit=0&content_type=image%2Fpng&fsize=490096&hid=9fa692657191070cc11adac12c41b091&media_type=image&tknv=v2&etag=72184792faf353d534ba0bad4bbb00e8)
Ooops, query returned an error:
![Example 4](https://raw.githubusercontent.com/orderbynull/lottip/master/shots/4.png)
![Example 3](https://4.downloader.disk.yandex.ru/disk/193675e44a0db993aa65e58900ef1f7f6b4ecd01448480ed90600c2b1e483495/5952cd0e/fKqInKw3d7bLFOeFnMGnhJWYcZLrDbJ2m4Ak3bcAhlbBVUXp0oG_6XUrPQumLMcZp2j7Ne5xIPM6_Kl6F49JukxTSTqvk8hav2RNxfSeYhKr8npumZHI4midPdWhecNq?uid=0&filename=error.png&disposition=inline&hash=&limit=0&content_type=image%2Fpng&fsize=475041&hid=5a82c44688dcb6a3ceec8cfb04d03143&media_type=image&tknv=v2&etag=e52f07e3149ab48ebbbb3805466d88b8)
Each query can be executed right from the app:
![Example 4](https://2.downloader.disk.yandex.ru/disk/28539b74a03c0f8e08ad048eca4cd0a00d3145c5261c66291f31f9837459a55b/5952cd2a/fKqInKw3d7bLFOeFnMGnhEPh6u0x8S8JJr_NiRfyge4I2oaBbqGsQkgPUs-6m9Q6GBCqLoGbFe9sx_rNyVeCQAnRijJwHc7qQqqKW9RpAkmr8npumZHI4midPdWhecNq?uid=0&filename=dialog.png&disposition=inline&hash=&limit=0&content_type=image%2Fpng&fsize=586418&hid=6a2c28a6b60fc17dac6672823d00cdc8&media_type=image&tknv=v2&etag=5c1abf8803c6cbc22ab923645a7f6a75)

# Main features
**Lottip is on it's early stage of development.**

For now you can:
1. See all queries sent from your application to MySQL grouped by connection it belongs to.
2. Track query execution result: success(green indicator), pending(yellow indicator) and error(red indicator).
3. Expand/collapse each query to see more/less details.
4. See query execution time.
5. Filter queries by string
3. See query execution time(it includes time to transfer data over network).
4. Filter queries by string.
5. Execute any query and see results immediately.

# Installation
###### Binary
Expand All @@ -32,13 +32,13 @@ Get binaries from [releases](https://github.com/orderbynull/lottip/releases) pag
go get github.com/orderbynull/lottip
go install github.com/mjibson/esc
cd $GOPATH/src/github.com/orderbynull/lottip
$GOPATH/bin/esc -o static/static.go -pkg="static" -prefix web -include=".*\.css|.*\.js|.*\.html|.*\.png" web
$GOPATH/bin/esc -o embed.go -prefix web -include=".*\.css|.*\.js|.*\.html|.*\.png" web
go build
./lottip

# How to run
There're 4 simple steps to get everything up and running:
1. Run binary from terminal like this: `./lottip_darwin_386`.
1. Run binary from terminal like this: `./lottip_linux_amd64`.
You'll see something like this:

`Forwarding queries from '127.0.0.1:4041' to '127.0.0.1:3306'`
Expand All @@ -61,7 +61,7 @@ This is an easy way to keep multiple app separated and view queries independentl
###### Use remotely
Let's say you're writing your PHP code locally but run it on dev server and do not want to expose lottip to outside world.
In this case here's what you may do:
1. Upload lottip binary to remote dev server and run it like this: `./lottip_darwin_386`
1. Upload lottip binary to remote dev server and run it like this: `./lottip_linux_amd64`
2. Create ssh tunnel from your local machine to remote dev server like this: `ssh -nNT -L 9999:127.0.0.1:9999 user@your-devserver.com`.
This command will map your local `:9999` to remote `:9999`
3. Tell your remote app to use MySQL on port `:4041`
Expand All @@ -76,6 +76,7 @@ You can change default values to whatever you need.
| `--proxy` | `127.0.0.1:4041`|`<ip>:<port>` of proxy server. Your code should make connections to that address to make proxy work. *Example: `--proxy=127.0.0.1:4045`*
| `--mysql` | `127.0.0.1:3306`|`<ip>:<port>` of MySQL server. *Example: `--mysql=192.168.0.195:3308`*
| `--gui` | `127.0.0.1:9999`|`<ip>:<port>` of embedded GUI. *Example: `--gui=127.0.0.1:8080`*
| `--mysql-dsn` | `""` |If you need to execute queries from the app you need to provide DSN for MySQL server. DSN format: `[username[:password]@][protocol[(address)]]/[dbname[?param1=value1&...&paramN=valueN]]` All values are optional. So the minimal DSN is `/dbname`. If you do not want to preselect a database, leave `dbname` empty: `/` *Example: `--mysql-dsn=root:root@/`*

# ToDo
- [ ] Write Unit tests
Expand Down

0 comments on commit 1aaad5d

Please sign in to comment.