Module Expr Str ImportFrom alias TryExcept body Import alias ImportFrom alias handlers ExceptHandler type NameLoad body Assign NameStore NameLoad Import alias Import alias Import alias ClassDef bases AttributeLoad AttributeLoad NameLoad attr attr body FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr Dict Str Str Dict Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Dict Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str If CompareNotEq AttributeLoad AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr attr Str body Assign SubscriptStore AttributeLoad NameLoad attr Index Str ListLoad SubscriptLoad AttributeLoad NameLoad attr Index Str If CompareIn Str AttributeLoad NameLoad attr body Assign NameStore BinOpMod Str TupleLoad SubscriptLoad AttributeLoad NameLoad attr Index Str SubscriptLoad AttributeLoad NameLoad attr Index Str SubscriptLoad AttributeLoad NameLoad attr Index Str SubscriptLoad AttributeLoad NameLoad attr Index Str SubscriptLoad AttributeLoad NameLoad attr Index Str Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call NameLoad NameLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Dict Str Str BinOpAdd BinOpAdd Str Str Str Str Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call NameLoad NameLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Dict Str Str Str Str ListLoad Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If CompareIs NameLoad NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Return TryExcept body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Return Dict Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Return Call NameLoad Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str TupleLoad NameLoad Assign NameStore Call NameLoad ListComp SubscriptLoad NameLoad Index Num comprehension NameStore NameLoad Assign NameStore Call NameLoad ListComp SubscriptLoad NameLoad Index Num comprehension NameStore NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr If BoolOpAnd CompareIn Num NameLoad CompareGt Call NameLoad SubscriptLoad NameLoad Index Num Num body Assign TupleStore NameStore NameStore SubscriptLoad SubscriptLoad NameLoad Index Num Slice Num If CompareNotIn NameLoad AttributeLoad NameLoad attr body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad Return Assign NameStore BinOpSub NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore BinOpMult BinOpSub NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Num If CompareEq NameLoad Num body Return Assign NameStore SubscriptLoad NameLoad Slice BinOpAdd Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr ListLoad Str Call NameLoad ListComp SubscriptLoad NameLoad Index Num comprehension NameStore NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Num attr Str Expr Call AttributeLoad NameLoad attr ListLoad Str BinOpSub Call NameLoad ListComp SubscriptLoad NameLoad Index Num comprehension NameStore NameLoad BoolOpAnd Call AttributeLoad SubscriptLoad NameLoad Index Num attr Str CompareNotIn SubscriptLoad NameLoad Index Num SubscriptLoad AttributeLoad NameLoad attr Index NameLoad SubscriptLoad SubscriptLoad NameLoad Index Num Index Num Expr Call AttributeLoad NameLoad attr ListLoad Str Call NameLoad ListComp SubscriptLoad NameLoad Index Num comprehension NameStore NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Num attr Str Expr Call AttributeLoad NameLoad attr ListLoad Str Call NameLoad ListComp SubscriptLoad NameLoad Index Num comprehension NameStore NameLoad BoolOpAnd Call AttributeLoad SubscriptLoad NameLoad Index Num attr Str CompareNotIn SubscriptLoad NameLoad Index Num SubscriptLoad AttributeLoad NameLoad attr Index NameLoad For NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad NameLoad body If CompareIn SubscriptLoad SubscriptLoad NameLoad Index Num Index Num SubscriptLoad AttributeLoad NameLoad attr Index NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd BinOpAdd NameLoad NameLoad Str SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index SubscriptLoad SubscriptLoad NameLoad Index Num Index Num BinOpMult BinOpDiv BinOpSub SubscriptLoad SubscriptLoad NameLoad Index Num Index Num SubscriptLoad SubscriptLoad NameLoad Index Num Index Num NameLoad Num Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd NameLoad NameLoad Str BinOpMult BinOpDiv Call NameLoad BinOpSub NameLoad NameLoad NameLoad Num Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body For NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str body Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad If UnaryOpNot NameLoad body Continue Assign NameStore Dict Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Num TryExcept body Assign SubscriptStore NameLoad Index Str Call NameLoad Call AttributeLoad NameLoad attr Num handlers ExceptHandler type NameLoad body Assign SubscriptStore NameLoad Index Str Num Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Num Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Num Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr Num If Call NameLoad NameLoad body AugAssignAdd NameStore Str Expr Call AttributeLoad NameLoad attr keyword NameLoad If SubscriptLoad AttributeLoad NameLoad attr Index Str body Expr Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list
N/A N/A 

Diamond collector that monitors relevant MySQL performance_schema values
For now only monitors replication load

[Blog](http://bit.ly/PbSkbN) announcement.

[Snippet](http://bit.ly/SHwYhT) to build example graph.

#### Dependencies

 * MySQLdb
 * MySQL 5.5.3+

 __future__ division N/A N/A N/A MySQLdb MySQLdb MySQLError N/A N/A N/A ImportError N/A N/A MySQLdb None N/A diamond N/A time N/A re MySQLPerfCollector N/A N/A N/A diamond collector Collector N/A process_config N/A N/A self N/A N/A N/A N/A N/A N/A super MySQLPerfCollector self process_config N/A N/A self db None N/A N/A self last_wait_count N/A N/A N/A self last_wait_sum N/A N/A N/A self last_timestamp N/A N/A N/A self last_data N/A N/A N/A self monitors N/A slave_sql slave_io N/A wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond wait/io/file/innodb/innodb_data_file wait/io/file/innodb/innodb_log_file wait/io/file/myisam/dfile wait/io/file/myisam/kfile wait/io/file/sql/binlog wait/io/file/sql/relay_log_info wait/io/file/sql/relaylog wait/synch/mutex/innodb wait/synch/mutex wait/synch/rwlock wait/io wait_for_update innodb_data_file innodb_log_file myisam_dfile myisam_kfile binlog relaylog_info relaylog innodb_mutex other_mutex rwlocks other_io N/A wait/io/file/sql/relaylog_index wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index wait/synch/mutex/sql/Master_info::data_lock wait/synch/mutex/mysys/IO_CACHE::append_buffer_lock wait/synch/mutex/sql/LOG::LOCK_log wait/io/file/sql/master_info wait/io/file/sql/relaylog wait/synch/mutex wait/synch/rwlock wait/io relaylog_index relaylog_index_lock master_info_lock append_buffer_lock log_lock master_info relaylog other_mutex rwlocks other_io N/A N/A N/A N/A N/A N/A self config N/A hosts __class__ __name__ list N/A N/A N/A N/A self config N/A hosts N/A N/A N/A self config N/A hosts N/A N/A host N/A self config N/A N/A hoststr N/A %s:%s@%s:%s/%s N/A N/A N/A self config N/A user N/A N/A self config N/A passwd N/A N/A self config N/A host N/A N/A self config N/A port N/A N/A self config N/A db N/A N/A N/A N/A N/A self config N/A hosts append hoststr N/A get_default_config_help N/A N/A self N/A N/A N/A config_help N/A N/A N/A super MySQLPerfCollector self get_default_config_help N/A N/A N/A config_help update N/A hosts slave N/A N/A List of hosts to collect from. Format is  yourusername:yourpassword@host: port/performance_schema[/nickname] Collect Slave Replication Metrics N/A config_help N/A get_default_config N/A N/A self N/A N/A N/A 
        Returns the default collector settings
         N/A config N/A N/A N/A super MySQLPerfCollector self get_default_config N/A N/A N/A config update N/A path hosts slave mysql N/A False N/A config N/A connect N/A N/A self params N/A N/A N/A N/A MySQLdb None N/A N/A N/A N/A N/A self log error Unable to import MySQLdb N/A N/A N/A N/A N/A self db N/A N/A MySQLdb connect params N/A N/A N/A MySQLError N/A e N/A N/A N/A N/A N/A self log error MySQLPerfCollector couldnt connect to database %s e N/A N/A N/A N/A N/A N/A self log debug MySQLPerfCollector: Connected to database. N/A query_list N/A N/A self query params N/A N/A N/A cursor N/A N/A N/A self db cursor N/A N/A N/A cursor execute query params N/A N/A list N/A N/A cursor fetchall N/A slave_load N/A N/A self nickname thread N/A N/A N/A data N/A N/A self query_list 
            SELECT
                his.event_name,
                his.sum_timer_wait,
                his.count_star,
                cur.event_name,
                UNIX_TIMESTAMP(SYSDATE())
            FROM
                events_waits_summary_by_thread_by_event_name his
                JOIN threads thr USING (thread_id)
                JOIN events_waits_current cur USING (thread_id)
            WHERE
                name = %s
            ORDER BY
                his.event_name
             N/A thread N/A wait_sum N/A sum N/A N/A x N/A 1 N/A x data N/A wait_count N/A sum N/A N/A x N/A 2 N/A x data N/A timestamp N/A int N/A N/A time time N/A N/A N/A 0 data N/A N/A len N/A data N/A 0 5 N/A N/A N/A cur_event_name timestamp N/A N/A data N/A 0 N/A 3 N/A N/A thread N/A self last_wait_sum N/A N/A N/A N/A self last_wait_sum N/A thread wait_sum N/A N/A N/A self last_wait_count N/A thread wait_count N/A N/A N/A self last_timestamp N/A thread timestamp N/A N/A N/A self last_data N/A thread data N/A N/A wait_delta N/A wait_sum N/A N/A self last_wait_sum N/A thread N/A time_delta N/A N/A timestamp N/A N/A self last_timestamp N/A thread 1000000000000 N/A N/A time_delta 0 N/A N/A N/A thread_name N/A thread N/A N/A N/A N/A thread rfind / 1 N/A N/A N/A data append N/A wait/synch/mutex/innodb N/A sum N/A N/A x N/A 1 N/A x data N/A N/A N/A x N/A 0 startswith wait/synch/mutex/innodb N/A N/A N/A data append N/A wait/synch/mutex N/A N/A sum N/A N/A x N/A 1 N/A x data N/A N/A N/A N/A x N/A 0 startswith wait/synch/mutex N/A N/A x N/A 0 N/A N/A self monitors N/A thread_name N/A N/A data N/A -1 N/A 1 N/A N/A N/A data append N/A wait/synch/rwlock N/A sum N/A N/A x N/A 1 N/A x data N/A N/A N/A x N/A 0 startswith wait/synch/rwlock N/A N/A N/A data append N/A wait/io N/A sum N/A N/A x N/A 1 N/A x data N/A N/A N/A N/A x N/A 0 startswith wait/io N/A N/A x N/A 0 N/A N/A self monitors N/A thread_name N/A d N/A zip N/A N/A self last_data N/A thread data N/A N/A N/A N/A N/A d N/A 0 N/A 0 N/A N/A self monitors N/A thread_name N/A N/A N/A N/A self publish N/A N/A N/A nickname thread_name . N/A N/A N/A self monitors N/A thread_name N/A N/A N/A d N/A 0 N/A 0 N/A N/A N/A N/A N/A d N/A 1 N/A 1 N/A N/A d N/A 0 N/A 1 time_delta 100 N/A N/A N/A self publish N/A N/A nickname thread_name .other_work N/A N/A N/A float N/A time_delta wait_delta time_delta 100 N/A N/A N/A self last_wait_sum N/A thread wait_sum N/A N/A N/A self last_wait_count N/A thread wait_count N/A N/A N/A self last_timestamp N/A thread timestamp N/A N/A N/A self last_data N/A thread data N/A collect N/A N/A self N/A N/A N/A host N/A N/A self config N/A hosts N/A N/A matches N/A N/A re search ^([^:]*):([^@]*)@([^:]*):?([^/]*)/([^/]*)/?(.*)$ host N/A N/A matches N/A N/A N/A params N/A N/A N/A params N/A host N/A N/A matches group 3 N/A N/A N/A N/A params N/A port N/A int N/A N/A matches group 4 N/A N/A N/A ValueError N/A N/A N/A params N/A port 3306 N/A N/A params N/A db N/A N/A matches group 5 N/A N/A params N/A user N/A N/A matches group 1 N/A N/A params N/A passwd N/A N/A matches group 2 N/A nickname N/A N/A matches group 6 N/A N/A len nickname N/A N/A nickname . N/A N/A N/A self connect params params N/A N/A N/A self config N/A slave N/A N/A N/A N/A self slave_load nickname thread/sql/slave_io N/A N/A N/A self slave_load nickname thread/sql/slave_sql N/A N/A N/A N/A self db close N/A N/A