mysql TPS和QPS查询sql

mysql TPS和qps查询sql

TPS查询

select VARIABLE_VALUE into @num_com from GLOBAL_STATUS
where VARIABLE_NAME =’COM_COMMIT’;
select VARIABLE_VALUE into @num_roll from GLOBAL_STATUS
where VARIABLE_NAME =’COM_ROLLBACK’;
select VARIABLE_VALUE into @uptime from GLOBAL_STATUS
where VARIABLE_NAME =’UPTIME’;
select (@num_com+@num_roll)/@uptime;

QPS查询

select VARIABLE_VALUE into @num_queries from GLOBAL_STATUS
where VARIABLE_NAME =’QUESTIONS’;
select VARIABLE_VALUE into @uptime from GLOBAL_STATUS
where VARIABLE_NAME =’UPTIME’;
select @num_queries/@uptime;

This entry was posted in mysql and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *