This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import re | |
# perf record -F 99 -p $1 -e "sched:sched_stat_runtime" -a -- sleep 20 | |
# perf script -F comm,pid,tid,cpu,time | python cpu_tenancy.py | |
# | |
# time-monitor-wo 79618/79634 [007] 11994704.695317: | |
# grpc-server-1 79618/79954 [006] 11994704.717969: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
interface=lo | |
ip=10.0.0.1 | |
delay=100ms | |
tc qdisc add dev $interface root handle 1: prio | |
tc filter add dev $interface parent 1:0 protocol ip prio 1 u32 match ip dst $ip flowid 2:1 | |
tc qdisc add dev $interface parent 1:1 handle 2: netem delay $delay |