Preface
 
    We've got a lot of files related with system performance which generated by pt-stalk in directory "/var/lib/pt-stalk" in my last blog.We can use "cat","more","less" to print the contents of them but it is really not convenient to do so.
 
Introduce
 
    pt-sift is the right tool helping us to retrieve diagnostic data easily.There're poor options of the tool to learn.Therefor,it's easy enough to sift the contents we need with no time.
 
Procedure
 
Usage
 pt-sift FILE|PREFIX|DIRECTORY
Examples
 
Print the output of the files generated by pt-stalk.
 [root@zlm2 :: /var/lib/pt-stalk]
#pt-sift
Error: is not a directory, and there are no pt-stalk files in the curent working directory (/var/lib/pt-stalk) with a prefix.
For more information, 'man pt-sift' or 'perldoc /usr/bin/pt-sift'. [root@zlm2 :: /var/lib/pt-stalk]
#pt-sift /var/lib/pt-stalk 2018_07_09_08_19_39 2018_07_09_08_24_39 Select a timestamp from the list [2018_07_09_08_24_39] 2018_07_09_08_19_39
======== zlm2 at 2018_07_09_08_19_39 DEFAULT ( of ) ========
--diskstats--
#ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
{} sda 2.4 16.9 0.0 % 0.0 2.6 26.2 48.9 1.2 % 0.1 4.7 % 28.6 3.5 1.1
sda % % % . . . . . . . . . . . . . . . . . . . . . % % . . . .
--vmstat--
r b swpd free buff cache si so bi bo in cs us sy id wa st wa % . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
--innodb--
txns: 3xnot (0s)
queries inside InnoDB, queries in queue
Main thread: sleeping, pending reads , writes , flush
Log: lsn = , chkp = , chkp age =
Threads are waiting at:
Threads are waiting on:
--processlist--
State starting
executing
Command
Sleep
Query
--stack traces--
No stack trace file exists
--oprofile--
No opreport file exists //It won't exit until you input "q".
//Further more,you can input other keystrokes to navigate the contents you want.
Check the disk relevant output by press "q" in above output.
 ======== zlm2 at 2018_07_09_08_19_39 DISKSTATS ( of ) ========
Starting /usr/bin/pt-diskstats #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
1.0 sda 41.2 18.2 0.7 % 0.1 3.4 24.7 35.0 0.8 % 0.0 1.8 % 65.8 1.9 0.9
1.0 sda2 41.2 18.2 0.7 % 0.1 3.4 20.6 42.0 0.8 % 0.0 1.1 % 61.7 2.0 0.6
1.0 dm- 41.2 18.2 0.7 % 0.1 3.4 20.6 42.0 0.8 % 0.0 2.1 % 61.7 2.0 0.9 //too many lines here,they've been ommited. #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
28.0 sda 0.0 0.0 0.0 % 0.0 0.0 18.4 29.9 0.5 % 0.0 1.0 % 18.4 0.1 0.9
28.0 sda2 0.0 0.0 0.0 % 0.0 0.0 14.6 37.9 0.5 % 0.0 0.6 % 14.6 0.1 0.5
28.0 dm- 0.0 0.0 0.0 % 0.0 0.0 14.6 37.9 0.5 % 0.0 1.3 % 14.6 0.1 1.1
28.0 dm- 0.0 0.0 0.0 % 0.0 0.0 0.0 0.0 0.0 % 0.0 0.0 % 0.0 0.0 0.0 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stimePress a key to continue or choose a different action
Check the innodb status relevant output by press "q",then press "i" in above output.
 Press a key to continue or choose a different action
======== zlm2 at 2018_07_09_08_19_39 INNODB ( of ) ========
Viewing InnoDB files
... //Several otmitted blank rows here.
*************************** . row ***************************
Type: InnoDB
Name:
Status:
=====================================
-- :: 0x7f7ce8211700 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: srv_active, srv_shutdown, srv_idle
srv_master_thread log flush and writes:
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count
OS WAIT ARRAY INFO: signal count
RW-shared spins , rounds , OS waits
RW-excl spins , rounds , OS waits
RW-sx spins , rounds , OS waits
Spin rounds per wait: 1009.00 RW-shared, 29932.00 RW-excl, 30.00 RW-sx
------------
TRANSACTIONS
------------
Trx id counter
Purge done for trx's n:o < 363858 undo n:o < 0 state: running
History list length
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION , not started
lock struct(s), heap size , row lock(s)
... //Omitted.
Check the net relevant output by press "q",then press "n" in above output.
 Press a key to continue or choose a different action
======== zlm2 at 2018_07_09_08_19_39 NETWORK ( of ) ========
Source of connections to port
192.168.1.101 Status of connections to port
ESTABLISHED
LISTEN
Press a key to continue or choose a different action
Check the first four samples of "show status" by press "m".
 ======== zlm2 at 2018_07_09_08_24_39 MEXT ( of ) ========
Displaying the first samples of SHOW STATUS counters
... //Several otmitted blank rows here.
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
Com_alter_event
Com_alter_function
Com_alter_instance
Com_alter_procedure
Com_alter_server
Com_alter_table
Com_alter_tablespace
Com_alter_user
Com_analyze
Com_assign_to_keycache
Com_begin
... //Omitted.
Check the file list by press "q",then press "0" in above output.
 ======== zlm2 at 2018_07_09_08_19_39 LIST ( of ) ========
-rw-r--r-- root root 17K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-df
-rw-r--r-- root root Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-disk-space
-rw-r--r-- root root 15K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-diskstats
-rw-r--r-- root root Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-hostname
-rw-r--r-- root root .3K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-innodbstatus1
-rw-r--r-- root root .5K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-innodbstatus2
-rw-r--r-- root root 33K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-interrupts
-rw-r--r-- root root 11K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-lsof
-rw-r--r-- root root 37K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-meminfo
-rw-r--r-- root root Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-mutex-status1
-rw-r--r-- root root Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-mutex-status2
-rw-r--r-- root root 1.1M Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-mysqladmin
-rw-r--r-- root root 48K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-netstat
-rw-r--r-- root root 51K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-netstat_s
-rw-r--r-- root root .2K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-opentables1
-rw-r--r-- root root .2K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-opentables2
-rw-r--r-- root root 25K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-output
-rw-r--r-- root root .7K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-pmap
-rw-r--r-- root root 40K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-processlist
-rw-r--r-- root root 25K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-procstat
-rw-r--r-- root root 71K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-procvmstat
-rw-r--r-- root root .4K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-ps
-rw-r--r-- root root 290K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-slabinfo
-rw-r--r-- root root 28K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-sysctl
-rw-r--r-- root root .1K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-top
-rw-r--r-- root root 73K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-transactions
-rw-r--r-- root root Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-trigger
-rw-r--r-- root root 17K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-variables
-rw-r--r-- root root .8K Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-vmstat
-rw-r--r-- root root Jul : /var/lib/pt-stalk/2018_07_09_08_19_39-vmstat-overall //It merely output the files relevant with the prefix("2018_07_09_08_19_39") you've specified.
Check all the contents of files by press "*" in above output.
 ======== zlm2 at 2018_07_09_08_19_39 VIEW ( of ) ========
Viewing all files //This time we'll check all the contents in each file.
... //Several otmitted blank rows here.
TS 1531117181.030895281 -- ::
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/centos-root % /
devtmpfs % /dev
tmpfs % /dev/shm
tmpfs % /run
tmpfs % /sys/fs/cgroup
/dev/sda1 % /boot
none % /vagrant
TS 1531117182.002834196 -- ::
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/centos-root % /
devtmpfs % /dev
tmpfs % /dev/shm
tmpfs % /run
tmpfs % /sys/fs/cgroup
/dev/sda1 % /boot
none % /vagrant
TS 1531117183.011493818 -- ::
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/centos-root % /
devtmpfs % /dev
tmpfs % /dev/shm
tmpfs % /run
tmpfs % /sys/fs/cgroup
/dev/sda1 % /boot
none % /vagrant
TS 1531117184.019711999 -- ::
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/centos-root % /
devtmpfs % /dev
/var/lib/pt-stalk/2018_07_09_08_19_39-df (file of ) //There're 30 files in all relative to the prefix.
Summary
  • pt-sift is a tool used to quikly sift contents of the files generated by pt-stalk by variety.
  • pt-sift can impove your efficiency in retrieving huge amount of files by specifying prefix.
  • pt-sift relies on pt-stalk and even downloads the necessary tool when using the function of them,such as pt-diskstats,pt-mext,etc.
 

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

  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. phpwind本地安装 inernal server error错误

    wampserver2.2环境,本地安装phpwind9.0时出错: Internal Server Error The server encountered an internal error or ...

  2. 自定义Qt组件-通讯模块(P3)

    1.   半双工模式实时检测串口 ComHalfDuplex类是为了解决上位机发送控制指令和下位机发送数据会在半双工RS485总线中产生冲突引起乱码而引入的(v0.010版本引入). 解决冲突的原理主 ...

  3. [转]asp.net core视图组件(ViewComponent)简单使用

    本文转自:http://www.cnblogs.com/dralee/p/6170496.html 一.组成: 一个视图组件包括两个部分,派生自ViewComponent的类及其返回结果.类似控制器. ...

  4. element中遇到的表格问题总结

    1.列表表头的颜色自定义 <el-table :data="pageData" style="width: 100%;" height="500 ...

  5. logback配置说明

    我觉得对于logback大家不太明白的有:过滤器.logger和root以及其中的一些属性的关系.其他的应该不是多迷糊,所以我就主要说说这几个的关系,并且为了清晰我只说控制台日志,写到文件的日志配置大 ...

  6. hibernate课程 初探一对多映射2-5 创建持久化类并配置映射文件

    学习点: 1 一对多映射,一方 Grade.hbm.xml的写法: <hibernate-mapping> <class name="com.ddwei.entity.Gr ...

  7. IDEA插件JRebel安装配置与破解激活详细教程(转)

    JRebel 介绍 IDEA上原生是不支持热部署的,一般更新了 Java 文件后要手动重启 Tomcat 服务器,才能生效,浪费不少生命啊.目前对于idea热部署最好的解决方案就是安装JRebel插件 ...

  8. 安装office提示Office 16 Click-to-Run Extensibility Component

    今天安装office时,提示Office 16 Click-to-Run Extensibility Component或者Office 15 Click-to-Run Extensibility C ...

  9. angularjs ng-if 慎用 备忘

    ng-if.ng-show一般情况下可以通用,二者的最明显区别就是: ng-if判断为false时,页面dom节点不会被创建,其子节点下也不会渲染,从而也就加快了dom的加载速度:ng-show则仅是 ...

  10. 爆料!如何在Visual Studio 2017上体验五星级云服务

    2017 年 3 月初,号称宇宙最强 IDE 之一的 Visual Studio 发布了最新的 2017 版本,遥想自己使用 VC++ 6.0 的当年,看着现在已然稀疏的头发,真是一入 IT 似海深, ...