zoukankan      html  css  js  c++  java
  • mysql 监控qps脚本

    mysqladmin -h172.16.200.43 -uroot -p  status -i 1
    
    #!/bin/bash
    mysqladmin -uroot -h172.16.200.43 -p'000000' extended-status -i1|awk 'BEGIN{local_switch=0;print "QPS   Commit Rollback   TPS    Threads_con Threads_run 
    ------------------------------------------------------- "}
         $2 ~ /Queries$/            {q=$4-lq;lq=$4;}
         $2 ~ /Com_commit$/         {c=$4-lc;lc=$4;}
         $2 ~ /Com_rollback$/       {r=$4-lr;lr=$4;}
         $2 ~ /Threads_connected$/  {tc=$4;}
         $2 ~ /Threads_running$/    {tr=$4;
            if(local_switch==0)
                    {local_switch=1; count=0}
            else {
                    if(count>10)
                            {count=0;print "------------------------------------------------------- 
    QPS   Commit Rollback   TPS    Threads_con Threads_run 
    ------------------------------------------------------- ";}
                    else{
                            count+=1;
                            printf "%-6d %-8d %-7d %-8d %-10d %d 
    ", q,c,r,c+r,tc,tr;
                    }
            }
    }'
    
  • 相关阅读:
    k8s的包管理
    k8s的paas平台
    zookeeper相关
    java之rpc/orm
    java之spring
    EK算法
    SAM学习笔记
    生日悖论不是“悖论”!
    分块--莫队学习粗略预习
    二项式反演学习笔记
  • 原文地址:https://www.cnblogs.com/xmzncc/p/6373834.html
Copyright © 2011-2022 走看看