Preface
 
    We are always obliged to analyze many outputs generated by various tools directly even in flat text files in server performance diagnosis.Further more,we need to compare the differences depend on these results such as the output of "mysqladmin" tool.
 
Introduce
 
    pt-mext is tht very tool which can help you to accomplish the work mentioned above easily.It can execute the command which you specify then print the result side-by-side in one line.Not only can it print results from a running program but also can it print results from a flat text file.
 
Procedure
 
Usage
 pt-mext [OPTIONS] -- COMMAND
Common Parameters
 --relative //Each column substracts the value of the column before it.
Example
 
Collect the global status of MySQL with 1s interval and 3 times in all by mysqladmin.
 [root@zlm2 :: ~]
#mysqladmin ext -i1 -c3 > mysqladmin.log [root@zlm2 :: ~]
#ls -l
total
-rw-------. root root Jul anaconda-ks.cfg
-rwxr-xr-x root root Jun : mysql-5.7.-linux-glibc2.-x86_64.tar
-rw-r--r-- root root Jul : mysqladmin.log
-rwxr-xr-x root root Jun : mysqld.sh
-rwxr-xr-x root root Jun : percona-toolkit-3.0.-.el7.x86_64.rpm
drwxr-xr-x root root Jul : sysbench-1.0
The "mysqladmin.log" file contains all the output of the three times individually.
 [root@zlm2 :: ~]
#cat mysqladmin.log
+-----------------------------------------------+--------------------------------------------------+
| Variable_name | Value |
+-----------------------------------------------+--------------------------------------------------+
| Aborted_clients | |
| Aborted_connects | |
| Binlog_cache_disk_use | |
| Binlog_cache_use | |
| Binlog_stmt_cache_disk_use | |
| Binlog_stmt_cache_use | |
| Bytes_received | |
| Bytes_sent | |
| Com_admin_commands | |
| Com_assign_to_keycache | |
| Com_alter_db | |
| Com_alter_db_upgrade | |
... +-----------------------------------------------+--------------------------------------------------+
| Variable_name | Value |
+-----------------------------------------------+--------------------------------------------------+
| Aborted_clients | |
| Aborted_connects | |
| Binlog_cache_disk_use | |
| Binlog_cache_use | |
| Binlog_stmt_cache_disk_use | |
| Binlog_stmt_cache_use | |
| Bytes_received | |
| Bytes_sent | |
| Com_admin_commands | |
| Com_assign_to_keycache | |
| Com_alter_db | |
| Com_alter_db_upgrade | |
... +-----------------------------------------------+--------------------------------------------------+
| Variable_name | Value |
+-----------------------------------------------+--------------------------------------------------+
| Aborted_clients | |
| Aborted_connects | |
| Binlog_cache_disk_use | |
| Binlog_cache_use | |
| Binlog_stmt_cache_disk_use | |
| Binlog_stmt_cache_use | |
| Bytes_received | |
| Bytes_sent | |
| Com_admin_commands | |
| Com_assign_to_keycache | |
| Com_alter_db | |
| Com_alter_db_upgrade | |
Execute pt-mext to print them again with the "mysqladmin.log" file.
 [root@zlm2 :: ~]
#pt-mext -- cat mysqladmin.log
Aborted_clients
Aborted_connects
Binlog_cache_disk_use
Binlog_cache_use
Binlog_stmt_cache_disk_use
Binlog_stmt_cache_use
Bytes_received
Bytes_sent
Com_admin_commands
Com_alter_db
Com_alter_db_upgrade
... //pt-mext arranges the results of those three times side-by-side and print them.
//The first column shows the first collected result and the second column shows the second one.
//The number of columns is n-1(n is the collection times here).
Specify the "--relative" option to get the differential data.
 [root@zlm2 :: ~]
#pt-mext --relative -- cat mysqladmin.log
Aborted_clients
Aborted_connects
Binlog_cache_disk_use
Binlog_cache_use
Binlog_stmt_cache_disk_use
Binlog_stmt_cache_use
Bytes_received //2277-2142=35
Bytes_sent //165275-155447=9828
Com_admin_commands
Com_alter_db
Com_alter_db_upgrade //Differential data is more distinct for us to know about the variation of performance.
//Even though we use "--relative" option,there're still two columns here.
Execute pt-mext without flat text file.
 [root@zlm2 :: ~]
#pt-mext -r -- mysqladmin ext -i1 -c3
Aborted_clients
Aborted_connects
Binlog_cache_disk_use
Binlog_cache_use
Binlog_stmt_cache_disk_use
Binlog_stmt_cache_use
Bytes_received
Bytes_sent
Com_admin_commands
Com_alter_db
Com_alter_db_upgrade
... [root@zlm2 :: ~]
#pt-mext -- mysqladmin ext -i1 -c3
Aborted_clients
Aborted_connects
Binlog_cache_disk_use
Binlog_cache_use
Binlog_stmt_cache_disk_use
Binlog_stmt_cache_use
Bytes_received
Bytes_sent
Com_admin_commands
Com_alter_db
Com_alter_db_upgrade
...
Summary
  • pt-mext has only three options and it is rather easy to use.
  • pt-mext is a useful tool in anaylzing differential data of global status of  MySQL.
  • pt-mext can be used not not only in "mysqladmin" program but also others.
 

Percona-Tookit工具包之pt-mext的更多相关文章

  1. Linux后台开发工具箱

    https://files-cdn.cnblogs.com/files/aquester/Linux后台开发工具箱.pdf 目录 目录 1 1. 前言 3 2. 脚本类工具 3 2.1. sed命令- ...

  2. Mysql: pt-table-checksum 和 pt-table-sync 检查主从一致性,实验过程

    一.安装 percona 包 1.安装仓库的包 https://www.percona.com/doc/percona-repo-config/yum-repo.html sudo yum insta ...

  3. Linux后台开发工具箱-葵花宝典

    Linux后台开发工具箱-葵花宝典 一见 2016/11/4 目录 目录 1 1. 前言 4 2. 脚本类工具 4 2.1. 双引号和单引号 4 2.2. 取脚本完整文件路径 5 2.3. 环境变量和 ...

  4. 推荐几款MySQL相关工具

    前言: 随着互联网技术的不断发展, MySQL 相关生态也越来越完善,越来越多的工具涌现出来.一些公司或个人纷纷开源出一些不错的工具,本篇文章主要介绍几款 MySQL 相关实用工具.提醒下,这里并不介 ...

  5. [知识库分享系列] 二、.NET(ASP.NET)

    最近时间又有了新的想法,当我用新的眼光在整理一些很老的知识库时,发现很多东西都已经过时,或者是很基础很零碎的知识点.如果分享出去大家不看倒好,更担心的是会误人子弟,但为了保证此系列的完整,还是选择分享 ...

  6. SQL慢查询安装过程

    SQL慢查询 基本操作 打开防火墙 firewall-cmd --zone=public --add-port=3306/tcp --permanent firewall-cmd --reload 安 ...

  7. 快速安装Percona pt工具

    yum install perl-DBI perl-DBD-MySQL perl-Time-HiRes perl-Time-HiRes perl-IO-Socket-SSLwget http://pk ...

  8. Percona 工具包 pt-online-schema-change 简介

    mysql的在线表结构修改,因为低效和阻塞读写.一直被诟病.至于ALTER TABLE 的原理,参看我上一篇文章.MySQL在线修改大表结构.看完后,发现的问题是还是会锁的,且对于在线更新的这块也是不 ...

  9. 安装percona工具包

    1.安装percona源 sudo yum install http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona- ...

  10. percona pt toolkit 总结

    ##=====================================================##pt-osc之工作流程:1.检查更改表是否有主键或唯一索引,是否有触发器2.检查修改表 ...

随机推荐

  1. POJ 3164——Command Network——————【最小树形图、固定根】

    Command Network Time Limit: 1000MS   Memory Limit: 131072K Total Submissions: 15080   Accepted: 4331 ...

  2. Day5下

    T1 #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> ...

  3. Linux下svn环境搭建

    不久前买了一个阿里云服务器,想着在上面搭建一个svn服务方便自己的代码管理.顺便记录下自己的搭建过程 首先,安装服务 通过yum -stall subversion 安装snv,可能install之前 ...

  4. java webServer(一)

    java webServer实现 浏览器和服务器使用的是http协议,http协议使用的是tcp 这里主要在服务器端监听端口号 实现功能 通过浏览器向服务器发送http请求:http://localh ...

  5. 什么是TOPO学

    拓扑,一个跟门萨同样古怪的“科技Word”.其定义,对绝大多数读者而言,不一定需要理解,但无妨知道———拓扑学,数学的一门分科,研究几何图形在一对一的双方连续变换下不变的性质.不少门萨题,来自拓扑学, ...

  6. springboot利用mail配置包,实现邮件发送

    了解邮件发送与接收的过程: A->S1->S2->B 1.计算机A通过SMTP协议将邮件发送到服务器S1上: 2.服务器S1再发送到服务器S2: 3.计算机B通过POP3协议接收服务 ...

  7. u-boot分析(十)----堆栈设置|代码拷贝|完成BL1阶段

    u-boot分析(十) 上篇博文我们按照210的启动流程,分析到了初始化nand flash,由于接下来的关闭ABB比较简单所以跳过,所以我们今天按照u-boot的启动流程继续进行分析. 今天我们会用 ...

  8. 爬虫技术框架——Heritrix

    Heritrix是一个由Java开发的开源Web爬虫系统,用来获取完整的.精确的站点内容的深度复制, 具有强大的可扩展性,运行开发者任意选择或扩展各个组件,实现特定的抓取逻辑. 一.Heritrix介 ...

  9. jstl Maven 依赖导致的 Jar 包冲突

    概述 Jar 包冲突是日常开发过程中,时常会遇到的问题.本文介绍由 jstl 的 Maven 依赖导致的 Jar 包冲突问题,以及对应的解决方法. jstl 的 Maven 依赖配置 <depe ...

  10. 如何计算并测量ABAP及Java代码的环复杂度Cyclomatic complexity

    代码的环复杂度(Cyclomatic complexity,有的地方又翻译成圈复杂度)是一种代码复杂度的衡量标准,在1976年由Thomas J. McCabe, Sr. 提出. 在软件测试的概念里, ...