如何使用Jmeter将参数化存储过程的select查询结果转换为单个文件

时间:2016-08-29 11:27:29

标签: stored-procedures jmeter performance-testing

我正在查询。

  1. 我正在使用存储过程。我想使用带参数化的Jmeter来运行它。

    {call ssp_Devx_ClientInvoiceNewTabReport (?,?,?,?,?,?,?,?)}
    //Till here I am able to do it.
    
  2. 现在我想在参数化后触发一个选择查询。
  3. 查询

        SELECT TOP 1 d.object_id, d.database_id,OBJECT_NAME(object_id,database_id) 'proc name',
        d.cached_time,d.last_execution_time, d.total_elapsed_time,
        (d.total_elapsed_time/d.execution_count)/1000 AS[avg_elapsed_time],
        d.last_elapsed_time/1000 as last_elapsed_time,d.execution_count,
        *FROM sys.dm_exec_procedure_stats AS d Where
        OBJECT_NAME(object_id,database_id)='ssp_Devx_ClientInvoiceNewTabReport' 
        Order by d.Last_Execution_Time DESC
        // For this I added this as another JDBC request.
    
    1. Select查询给了我很多记录。我想获取一些记录,如last_elapsed_time," total_worker_time"对于每组参数化数据和我希望保存到单个文件中的整个结果。

    2. 我添加了文件侦听器和图形侦听器,但是对于每个参数化数据集,它们都会在不同的文件中提供结果,并且所有结果都由选择查询返回。

    3. 问题:

      1. 有什么方法可以确保在每个参数化数据集之后触发选择请求。

      2. 有没有办法可以将每个参数的选择查询结果存储到文件中。

      3. 任何帮助/猜测/链接都将不胜感激。

1 个答案:

答案 0 :(得分:0)

查看Debugging JDBC Sampler Results in JMeter指南的An example of iterating the result set using Beanshell PostProcessor节。

它应该让您了解JDBC请求结果的样子以及如何使用它们