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. stm32 PWM输出学习

    STM32 的定时器除了 TIM6 和 7,其他的定时器都可以用来产生 PWM 输出.其中高级定时器 TIM1 和 TIM8 可以同时产生多达 7 路的 PWM 输出.通用定时器也能同时产生多达 4路 ...

  2. pat1048. Find Coins (25)

    1048. Find Coins (25) 时间限制 50 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Eva loves t ...

  3. PhpStorm快捷键设置,个性化设置,多项目共存,更改样式主题字体

    自定义常用快捷键 按照路径:File -> Settings -> Appearance & Behavior -> Keymap -> Copy 一份 Eclipse ...

  4. SSH密钥登录原理

    Client 发送请求 login 请求 --> Server 接受请求 --> 根据 authorized_key 文件中的对应 Client 的 ip 地址的公钥对一串随机数进行加密 ...

  5. Facebook TSDB论文Gorilla分析

    Facebook TSDB论文Gorilla分析 背景 TSDB时序数据库用于存储时间相关的数据,常用于监控系统的数据存储,分布式的TSDB提供了海量的数据存储能力,如InfluxDB.OpenTSD ...

  6. Controller的使用

  7. Redis入门--(二)Jedis的入门

    Jedis相应的jar包 编写一段程序来测试一下 1.新建一个Java的项目 2.引入jedis开发包 3.将包添加到构建路径中 4.创建一个测试类 5.创建一个Jedis的单实例的测试

  8. 从零开始的全栈工程师——js篇(作用域 this 原型笔试题练习)

    作用域 // 1. fn() function fn () { console.log(12) } var as = function () { console.log(45) } // 2. var ...

  9. Android GreenDao清空数据库的方法

    最近在做项目的时候,为了方便测试人员测试,在应用中加入正式库和测试库切换的功能.为了防止正式库和测试库切换带来的数据冲突,切换的时候必须把当前的数据库清空.代码如下: package com.exam ...

  10. 我的ORM框架

    任何系统的基础,都可以算是各种数据的增删改查(CRUD).最早操作数据是直接在代码里写SQL语句,后来出现了各种ORM框架.C#下的ORM框架有很多,如微软自己的Entity Framework.第三 ...