我知道用于单元测试的utplsql,有没有办法在循环中使用它来对存储过程进行负载测试?
I know of utplsql for unit testing, is there a way I could use this in a loop to load test my stored procedure?
我不想使用JMeter或使用任何JDBC驱动程序-只是想分析香草存储过程的性能
I dont want to use JMeter or go through any JDBC drivers - just trying to analyze the performance of the vanilla Stored Proc
推荐答案我认为单元测试工具不是正确的方法,因为您并没有真正对功能进行断言.通过负载测试,您想知道一个过程如何处理大量数据,以及是否被多次调用.
I don't think a unit test tool is the right approach, because you're not really making assertions about functionality. With a load test you want to know how a procedure runs with a large volume of data, of if it's called lots of times.
因此,您可能希望循环运行或针对大表运行它,并使用探查器查找毛刺.如果您使用的是11g,则应查看内置的分层探查器.
So you might want to run it in a loop or against a big table and use a profiler to find bootlenecks. If you're on 11g you should check out the built-in hierarchical profiler.
类似这样的东西:
begin DBMS_HPROF.START_PROFILING ( location => 'PROF_DATA_FILE_DIR' , filename => 'HPROF_RUN1_20111109' ); some_pkg.generate_lots_of_work(p_id => 1234); DBMS_HPROF.STOP_PROFILING; end; /或循环:
begin DBMS_HPROF.START_PROFILING ( location => 'PROF_DATA_FILE_DIR' , filename => 'HPROF_RUN2_20111109' ); for i in 1..1000 loop some_pkg.do_this(p_num => i); end loop; DBMS_HPROF.STOP_PROFILING; end; /很显然,这不会帮助您生成用于负载测试的数据块.这始终是最难的部分:)
Obviously, this won't help you in generating the gobs of data for load testing. That's always the hardest part :)
更多推荐
是否有用于负载测试PLSQL的工具
发布评论