-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aleksandr Fedotov
committed
Jun 27, 2017
1 parent
a6645ff
commit 1aaad5d
Showing
2 changed files
with
15 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
/esc | ||
.idea | ||
server | ||
embed | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
 | ||
Each query can be expanded for detailed view: | ||
 | ||
Bottom query freezed for 10 seconds: | ||
 | ||
 | ||
Query freezed for 10 seconds: | ||
 | ||
Ooops, query returned an error: | ||
 | ||
 | ||
Each query can be executed right from the app: | ||
 | ||
|
||
# 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 | ||
|
@@ -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'` | ||
|
@@ -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 [email protected]`. | ||
This command will map your local `:9999` to remote `:9999` | ||
3. Tell your remote app to use MySQL on port `:4041` | ||
|
@@ -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&...¶mN=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 | ||
|