5.53 BCC工具之dbslower.py解读

一,工具简介

dbstat用于追踪由MySQL或PostgreSQL数据库进程执行的查询,并显示查询延迟的直方图。

二,代码示例

#!/usr/bin/env python

from bcc import BPF, USDT
import argparse
import subprocess
from time import sleep, strftime

examples = """
    dbstat postgres     # display a histogram of PostgreSQL query latencies
    dbstat mysql -v     # display MySQL latencies and print the BPF program
    dbstat mysql -u     # display query latencies in microseconds (default: ms)
    dbstat mysql -m 5   # trace only queries slower than 5ms
    dbstat mysql -p 408 # trace queries in a specific process
"""
parser = argparse.ArgumentParser(
    description="",
    formatter_class=argparse.RawDescriptionHelpFormatter,
    epilog=examples)
parser.add_argument("-v", "--verbose", action="store_true",
    help="print the BPF program")
parser.add_argument("db", choices=["mysql", &

相关推荐

  1. 5.53 BCC工具dbslower.py解读

    2024-03-10 11:46:01       21 阅读
  2. 5.8 BCC工具mysqld_query.py解读

    2024-03-10 11:46:01       26 阅读
  3. 5.54 BCC工具dbstat.py解读

    2024-03-10 11:46:01       22 阅读
  4. 5.56 BCC工具funcslower.py解读

    2024-03-10 11:46:01       22 阅读
  5. 5.49 BCC工具rdmaucma.py解读

    2024-03-10 11:46:01       18 阅读
  6. 5.52 BCC工具dbslower.py解读

    2024-03-10 11:46:01       25 阅读
  7. 5.69 BCC工具runqlen.py解读

    2024-03-10 11:46:01       20 阅读
  8. 5.82 BCC工具tcpdrop.py解读

    2024-03-10 11:46:01       18 阅读
  9. 5.70 BCC工具runqslower.py解读

    2024-03-10 11:46:01       16 阅读
  10. 5.72 BCC工具wakeuptime.py解读

    2024-03-10 11:46:01       24 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-03-10 11:46:01       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-03-10 11:46:01       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-03-10 11:46:01       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-03-10 11:46:01       18 阅读

热门阅读

  1. c++中利用指针或应用如何安全的获取数据

    2024-03-10 11:46:01       20 阅读
  2. 学习方法 学习态度

    2024-03-10 11:46:01       22 阅读
  3. Unity3D XML与Properties配置文件读取详解

    2024-03-10 11:46:01       20 阅读
  4. Centos / RedHat 安装 Redis 、MinIO、Zookeeper、Kafka

    2024-03-10 11:46:01       21 阅读
  5. Linux安装Whisper-Jax

    2024-03-10 11:46:01       21 阅读
  6. 高维多元中介分析:另外8种方法

    2024-03-10 11:46:01       24 阅读
  7. C++设计模式-设计模式简述

    2024-03-10 11:46:01       22 阅读
  8. 10个与TensorFlow相关的练习题及答案

    2024-03-10 11:46:01       20 阅读
  9. 各种测试用例、测试难点

    2024-03-10 11:46:01       20 阅读
  10. Rust的Linfa和Polars库进行机器学习

    2024-03-10 11:46:01       24 阅读
  11. 数据结构---C语言版 408 2019-41题代码版

    2024-03-10 11:46:01       22 阅读
  12. vue 下拉选择框点击外部关掉下拉弹框

    2024-03-10 11:46:01       26 阅读
  13. 2024 年 React学习笔记(一)

    2024-03-10 11:46:01       21 阅读