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.
 

最新文章

  1. STL之list
  2. 【Android市场】提交应用的一点经验分享
  3. Mathematics:GCD &amp; LCM Inverse(POJ 2429)
  4. 最长公共子序列(加强版) Hdu 1503 Advanced Fruits
  5. Largest Number
  6. ThinkPHP公共配置文件与各自项目中配置文件组合的方法
  7. Magento Error – The directory is not writable by server.
  8. NOIP200504循环
  9. 输出一个对象的所有属性的值,可以不用反射机制,用JSON处理更方便
  10. 最小化安装Centos7后的部署(个人)
  11. Java按位置解析文本文件(使用Swing选择文件)
  12. 高仿拉手网底部菜单实现FragmentActivity+Fragment+RadioGroup
  13. Mysql中时间的操作笔记
  14. $http post 取不到数据
  15. SSRF漏洞浅析
  16. svn 基础
  17. tp5结合FormData实现ajax文件上传
  18. 《转载》python爬虫实践之模拟登录
  19. Python爬虫学习——获取网页
  20. 将int转int数组并将int数组元素处理后转int,实现加密

热门文章

  1. 05-spring整合jdbc-jdbc模板对象JdbcTemplate
  2. EDP项目结构规范心得
  3. Jetty数据同步使用
  4. Windows Server 2012 R2
  5. css内容整理1
  6. JAVA SE collection接口
  7. GitHub webstorm 及 README.md 姿势
  8. Android GreenDAO 3.0 不修改版本号的情况下增加、删除表、添加字段
  9. 【起航计划 009】2015 起航计划 Android APIDemo的魔鬼步伐 08 App-&gt;Activity-&gt;QuickContactsDemo 联系人 ResourceCursorAdapter使用 QuickContactBadge使用
  10. lucene查询解析器语法