add rpc count tracer

Change-Id: Ied86a60dad36661736a47ac4fa6d42f609582c9d
This commit is contained in:
Kun Huang 2015-11-04 23:57:42 +08:00
parent a0760df95a
commit c009cff9a4
3 changed files with 18 additions and 0 deletions

View File

@ -91,3 +91,6 @@ def parse_modelsave(out):
def parse_sqlaexec(out):
return _parse_count_stream(out, "Sqlalchemy-Execute")
def parse_rpccount(out):
return _parse_count_stream(out, "RPC-Count")

View File

@ -43,6 +43,7 @@ agents_map = {
"oslolock": "stap %s/oslo-lock.stp", # with sudo, need add current user to stapdev group
"modelsave": "stap %s/model-save.stp", # with sudo, need add current user to stapdev group
"sqlaexec": "stap %s/sqla-exec.stp", # with sudo, need add current user to stapdev group
"rpccount": "stap %s/rpc-count.stp", # with sudo, need add current user to stapdev group
}
def run(config):

14
scripts/rpc-count.stp Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/stap
global count = 0;
global old_count = 0;
probe python.function.entry {
if ((funcname == "call" || funcname == "cast") && isinstr(filename, "oslo_messaging/rpc/client.py") ) {
count = count + 1;
}
}
probe timer.ms(1000) {
new_count = count - old_count;
printf("%d\n", new_count);
old_count = count;
}