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. pat06-图7. How Long Does It Take (25)

    06-图7. How Long Does It Take (25) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue ...

  2. 亲测SQLServer的最大连接数

    很多做架构设计.程序开发.运维.技术管理的朋友可能或多或少有这样的困惑: SQLServer到底支持多少连接数的并发? SQLServer是否可以满足现有的应用吗? 现有的技术架构支持多少连接数的并发 ...

  3. java 正则表达式提取价格

    实例代码: public static void main(String[] args) { String str="11000.00元"; Pattern pattern = P ...

  4. 【转】Android事件分发机制完全解析,带你从源码的角度彻底理解(下)

    转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/9153761 记得在前面的文章中,我带大家一起从源码的角度分析了Android中Vi ...

  5. ajax多次请求的一个效果思路

    首先页面加载时候显示遮罩层 jQuery(function() { show_dialog(); //tianxie(); }); 定义一个全局数组,用于存放问题id var qar = []; 循环 ...

  6. node模块机制

    一.node模块化机制  1.commonJS模块规范包括三部分:模块引用.模块定义.模块标识.例如: //math.js exports.add = function(){    var sum = ...

  7. 在快速自定义的NopCommerce中使用实体框架(EF)代码优先迁移

    我看到很多nopCommerce论坛的用户问他们如何使用Entity Framework(EF)代码优先迁移来自定义nopCommerce,添加新的字段和entites核心.我实际上在做nopComm ...

  8. 关于VisualStudio2010发布项目问题

    VisualStudio2010速度还是很给力的,VS2015打开机器就双100%了:VS2010机器上跑起来还是很好用的. 今天编译一个MVC3.0项目,发布时候出现诡异现象:Content文件夹里 ...

  9. centos命令行常用操作

    1.查看某个端口占用 lsof -i tcp:80 2.查看是否安装了防火墙 service iptables status 查看是否启用防火墙/etc/init.d/iptables status ...

  10. iOS自动化打包发布(fastlane)

    一.FastLane介绍 1.1 FastLane是什么? FastLane是一种配置iOS和Android自动化Beta部署和发布的最简单的方法之一.它可以简化一些乏味.单调.重复的工作,像截图.代 ...