add rpc count tracer
Change-Id: Ied86a60dad36661736a47ac4fa6d42f609582c9d
This commit is contained in:
parent
a0760df95a
commit
c009cff9a4
@ -91,3 +91,6 @@ def parse_modelsave(out):
|
|||||||
|
|
||||||
def parse_sqlaexec(out):
|
def parse_sqlaexec(out):
|
||||||
return _parse_count_stream(out, "Sqlalchemy-Execute")
|
return _parse_count_stream(out, "Sqlalchemy-Execute")
|
||||||
|
|
||||||
|
def parse_rpccount(out):
|
||||||
|
return _parse_count_stream(out, "RPC-Count")
|
||||||
|
@ -43,6 +43,7 @@ agents_map = {
|
|||||||
"oslolock": "stap %s/oslo-lock.stp", # with sudo, need add current user to stapdev group
|
"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
|
"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
|
"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):
|
def run(config):
|
||||||
|
14
scripts/rpc-count.stp
Executable file
14
scripts/rpc-count.stp
Executable 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user