一,工具简介
dirtop按目录显示读取和写入情况.
二,代码示例
#!/usr/bin/env pythonfrom __future__ import print_function
from bcc import BPF
from time import sleep, strftime
import argparse
import os
import stat
from subprocess import call# arguments
examples = """examples:./dirtop -d '/hdfs/uuid/*/yarn' # directory I/O top, 1 second refresh./dirtop -d '/hdfs/uuid/*/yarn' -C # don't clear the screen./dirtop -d '/hdfs/uuid/*/yarn' 5 # 5 second summaries./dirtop -d '/hdfs/uuid/*/yarn' 5 10 # 5 second summaries, 10 times only./dirtop -d '/hdfs/uuid/*/yarn,/hdfs/uuid/*/data' # Running dirtop on two set of directories
"""
parser = argparse.ArgumentParser(description="File reads and writes by process",formatter_class=argparse.RawDescriptionHelpFormatter,epilog=examples)
parser.add_argument("-C", "--nocl