5.52 BCC工具之dbslower.py解读

一,工具简介

dbslower工具用于追踪由 MySQL 或 PostgreSQL 服务器提供的查询,并打印出那些超过延迟(查询时间)阈值的查询。默认情况下,使用的阈值是 1 毫秒。

二,代码示例

#!/usr/bin/env python

from bcc import BPF, USDT
import argparse
import re
import subprocess

examples = """examples:
    dbslower postgres            # trace PostgreSQL queries slower than 1ms
    dbslower postgres -p 188 322 # trace specific PostgreSQL processes
    dbslower mysql -p 480 -m 30  # trace MySQL queries slower than 30ms
    dbslower mysql -p 480 -v     # trace MySQL queries & print the BPF program
    dbslower mysql -x $(which mysqld)  # trace MySQL queries with uprobes
"""
parser = argparse.ArgumentParser(
    description="",
    formatter_class=argparse.RawDescriptionHelpFormatter,
    epilog=examples)
parser.add_argument("-v", "--verbose", action="store_true",
    help="print the BPF program")
par

相关推荐

  1. 5.52 BCC工具dbslower.py解读

    2024-03-11 13:10:02       47 阅读
  2. 5.8 BCC工具mysqld_query.py解读

    2024-03-11 13:10:02       52 阅读
  3. 5.54 BCC工具dbstat.py解读

    2024-03-11 13:10:02       45 阅读
  4. 5.56 BCC工具funcslower.py解读

    2024-03-11 13:10:02       45 阅读
  5. 5.53 BCC工具dbslower.py解读

    2024-03-11 13:10:02       41 阅读
  6. 5.49 BCC工具rdmaucma.py解读

    2024-03-11 13:10:02       42 阅读
  7. 5.69 BCC工具runqlen.py解读

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

    2024-03-11 13:10:02       39 阅读
  9. 5.70 BCC工具runqslower.py解读

    2024-03-11 13:10:02       35 阅读
  10. 5.72 BCC工具wakeuptime.py解读

    2024-03-11 13:10:02       42 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-11 13:10:02       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-11 13:10:02       100 阅读
  3. 在Django里面运行非项目文件

    2024-03-11 13:10:02       82 阅读
  4. Python语言-面向对象

    2024-03-11 13:10:02       91 阅读

热门阅读

  1. Linux开发的常用桌面界面有哪些?以及使用推荐

    2024-03-11 13:10:02       37 阅读
  2. linux安全配置规范

    2024-03-11 13:10:02       34 阅读
  3. 【c++11线程库的使用】

    2024-03-11 13:10:02       28 阅读
  4. 数据结构-双链表

    2024-03-11 13:10:02       44 阅读
  5. 如何在vue中使用sort对数组进行排序

    2024-03-11 13:10:02       42 阅读
  6. TensorFlow是啥

    2024-03-11 13:10:02       38 阅读