MySQL获取系统性能和状态代码
时间:2024-01-13 10:56:18
#!/bin/ksh
INTERVAL=5
PREFIX=$INTERVAL-sec-status
touch /tmp/running
RUNFILE=/tmp/running
my -e 'show global variables' >> mysql-variables
while test -e $RUNFILE; do
file=$(date +%F_%I)
sleep=$(date +%s.%N | awk "{print $INTERVAL - (\$1 % $INTERVAL)}")
sleep $sleep
ts="$(date +"TS %s.%N %F %T")"
loadavg="$(uptime)"
echo "$ts $loadavg" >> $PREFIX-${file}-status
my -e 'show global status' >> $PREFIX-${file}-status &
echo "$ts $loadavg" >> $PREFIX-${file}-innodbstatus
my -e 'show engine innodb status\G' >> $PREFIX-${file}-innodbstatus &
echo "$ts $loadavg" >> $PREFIX-${file}-processlist
my -e 'show full processlist\G' >> $PREFIX-${file}-processlist &
echo $ts
done
echo Exiting because $RUNFILE does not exist.
标签:MySQL,系统性能,系统状态
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
关于web标准的思考
2008-10-05 10:07:00
深入php var_dump()函数的详解
2023-11-08 16:09:01
mysql单字段多值分割和合并的处理方法
2024-01-16 23:49:00
![](https://img.aspxhome.com/file/2023/2/125672_0s.png)
python类装饰器用法实例
2023-06-25 11:12:38
python匿名函数的使用方法解析
2022-05-08 13:00:25
SQL SERVER的字段类型介绍
2008-05-23 13:27:00
成功解决ValueError: Supported target types are:('binary', 'multiclass'). Got 'continuous' instead.
2023-01-24 03:59:00
python3 pathlib库Path类方法总结
2022-06-10 18:38:11
对Python3中列表乘以某一个数的示例详解
2023-05-05 03:10:40
Python cookbook(数据结构与算法)在字典中将键映射到多个值上的方法
2023-07-14 14:37:00
pandas实现数据可视化的示例代码
2023-01-12 10:31:05
![](https://img.aspxhome.com/file/2023/5/97725_0s.png)
Django日志及中间件模块应用案例
2021-06-02 22:16:50
关于Flask项目无法使用公网IP访问的解决方式
2021-01-03 10:04:00
![](https://img.aspxhome.com/file/2023/3/107683_0s.jpg)
python编辑用户登入界面的实现代码
2022-02-07 20:24:08
![](https://img.aspxhome.com/file/2023/4/99124_0s.png)
PyTorch 如何自动计算梯度
2023-08-13 14:44:20
![](https://img.aspxhome.com/file/2023/7/59837_0s.jpg)
详解Django中类视图使用装饰器的方式
2023-12-20 15:35:57
mysql向mariadb平滑过渡的步骤详解
2024-01-26 18:12:39
Git下载与环境变量配置方法
2022-10-19 19:53:13
![](https://img.aspxhome.com/file/2023/0/132510_0s.jpg)
陌生网页交互行为分析(1)——奇怪的关闭按钮
2009-01-08 12:22:00
![](https://img.aspxhome.com/file/UploadPic/20091/8/2008-12-30_155447-20s.png)
SqlServer 按时间段查询问题
2024-01-19 02:15:35