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. Kudu安装前的建议说明(博主推荐)

    不多说,直接上干货! 能点击进来看我写的这篇博文的朋友,肯定是刚入门的你. 其实以下是我从官网翻译过来的. http://kudu.apache.org/docs/installation.html# ...

  2. UITableView分隔线

    问题1: 在ios中使用UITableView时,当行数较少是,可能一屏幕能显示完全所有行,这时候会出现下面的问题,显示多余的分隔线 图如下: 解决方案: //解决方案1 //添加如下代码 -(CGF ...

  3. CF1096C Polygon for the Angle

    思路: 要想到正n边形中所有可能的ang为180 * k / n (1 <= k <= n - 2). 根据n = 180 * k / ang, n是大于等于3的整数,并且n >= ...

  4. 移动webApp - 1像素实现(点5像素的秘密)

    在移动web项目中,经常会实现以下1像素的边框 移动web设计中,在retina显示屏下网页会由1px会被渲染为2px,那么视觉稿中1px的线条还原成网页需要css定义为0.5px 但是正当我们去用0 ...

  5. cookie乱码处理 示例

    package com.log; import java.io.IOException; import java.net.URLEncoder; import java.util.ArrayList; ...

  6. Android @1x,@2x,@3x 资源文件自动分包工具

    version 1.2 1.修改不用输入扩展名 2.输出路径可选.默认会在输入路径下建文件夹 前沿: 现在开发中ios,android会使用一套图,但是ui设计师给的图命名是以@1x,@2x,@3x这 ...

  7. 建堆复杂度O(n)证明

    堆排序中首先需要做的就是建堆,广为人知的是建堆复杂度才O(n),它的证明过程涉及到高等数学中的级数或者概率论,不过证明整体来讲是比较易懂的. 堆排过程 代码如下 void print(vector&l ...

  8. 笨办法学Python(十九)

    习题 19: 函数和变量 函数这个概念也许承载了太多的信息量,不过别担心.只要坚持做这些练习,对照上个练习中的检查点检查一遍这次的联系,你最终会明白这些内容的. 有一个你可能没有注意到的细节,我们现在 ...

  9. 详细讲解:通过composer安装TP5.1(Thinkphp5.1)

    现在TP5越来越火了,TP5也更新到了5.1版本,但是5.1以上版本只能通过composer来进行安装,那么这里贴出详细的步骤 前提:PHP版本必须要5.6以上 参考网址:http://www.thi ...

  10. TP5.0: 显示错误信息

    在TP5中,我们运行的代码有错误无法执行时,只显示页面错误,而不显示错误信息 对我我来讲是无法接受滴!!毕竟我还是个小渣渣,查看了百度,解决方案是: 在application/config,php中找 ...