add sqlalchemy execution tracer
Change-Id: I3e77ada0d6670240c23ead2a699f0f0ee2facb28
This commit is contained in:
parent
272792ef58
commit
a0760df95a
@ -88,3 +88,6 @@ def parse_oslolock(out):
|
||||
|
||||
def parse_modelsave(out):
|
||||
return _parse_count_stream(out, "Model-Save")
|
||||
|
||||
def parse_sqlaexec(out):
|
||||
return _parse_count_stream(out, "Sqlalchemy-Execute")
|
||||
|
@ -42,6 +42,7 @@ agents_map = {
|
||||
"traffic": "bash %s/device-input-traffic.sh eth0",
|
||||
"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
|
||||
}
|
||||
|
||||
def run(config):
|
||||
|
14
scripts/sqla-exec.stp
Executable file
14
scripts/sqla-exec.stp
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/stap
|
||||
|
||||
global count = 0;
|
||||
global old_count = 0;
|
||||
probe python.function.entry {
|
||||
if ((funcname == "execute") && isinstr(filename, "sqlalchemy/engine/base.py") && (lineno == 846)) {
|
||||
count = count + 1;
|
||||
}
|
||||
}
|
||||
probe timer.ms(1000) {
|
||||
new_count = count - old_count;
|
||||
printf("%d\n", new_count);
|
||||
old_count = count;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user