mysql 每秒钟查询次数、插入次数、删除次数、更新次数的统计

时间:2022-11-05 07:23:50
-show global status where Variable_name in('com_select','com_insert','com_delete','com_update');
查询出当前四种操作的总次数
x1
y1
z1
w1
--select sleep(60)
延时60秒
--show global status where Variable_name in('com_select','com_insert','com_delete','com_update');
一分钟后四种操作的总次数
x2
y2
z2
w2
 
计算每秒 各种操作的次数
每秒查询: (x1-x2)/60
每秒插入: (y1-y2)/60
每秒删除: (z1-z2)/60
每秒更新: (w1-w2)/60