Git Product home page Git Product logo

mysql-proxy-scripts-for-devs's Introduction

MySQL Proxy scripts for devs

This is a repository of useful MySQL Proxy scripts targetting mainly developers in quest of debugging.

Requirements

MySQL Proxy >= 0.8 (May work with earlier version, untested)

Running

$ mysql-proxy --proxy-lua-script=/absolute/path/to/the/script.lua

Scripts

debug.lua

Prints every SQL command received while cleaning obsolete spaces. Every command appears on one line with the following additional information:

  • an optional informative message about the query,
  • the number of rows returned or affected by the query,
  • the amout of time (in ms) it took to run the query.

Additionally, colors are used to provide direct information on the queries:

  • yellow: when not using a good index (no_good_index_used flag),
  • yellow + bold: when not using an index at all,
  • red: when an error occured,
  • pink: for queries affecting records.

Colors are also used to denote slow queries: time displayed in red instead of green. When a query returns no rows nor affect records, "" is displayed using red in reverse video.

If you want to force "SQL_NO_CACHE" in your SELECT statements you can set the use_sql_no_cache variable to 1.

debug-blind.lua

Same as debug.lua, but without shell colors.

log_all_queries.lua

Same as debug.lua, but logs to a file (/var/log/mysql-proxy/querydebug.log) and with different fields.

slow.lua

Simulates a server being slow because of huge traffic.

The sleep command accepting a float as argument is required to make this script works out of the box.

The slowdowns can be configured to make all requests longer by a factor or by a fixed amount of time (or both).

By default, requests are made twice slower with an additional overhead of 0.1s.

mysql-proxy-scripts-for-devs's People

Contributors

osterik avatar patrickallaert avatar plopix avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.