XKCD stick figure with chartLoadRunner Analysis is a powerful tool for understanding exactly what happened during a load test. You can use it to slice and dice your performance test results data, then you can export selected graphs/charts for your Performance Test Summary Report.

Some people may want to use a different tool to create charts from their LoadRunner test results. Fortunately, test results data is stored in a database, and there is an SQL query behind each graph/chart you see in LoadRunner Analysis. If you understand the LoadRunner Analysis database tables, you can write your own queries (unfortunately you can’t do this directly with LoadRunner Analysis), but the first step in writing your own queries is to get an understanding of the existing queries.

There are 142 different graphs available in LoadRunner Analysis 12.53. By default, only the graphs that have data available are shown.

LoadRunner Analysis graphs

The following graphs are available in LoadRunner Analysis 12.53:

  • Vusers
    • Running Vusers
    • Vuser Summary
    • Rendezvous
  • Errors
    • Error Statistics (by Description)
    • Errors per Second (by Description)
    • Error Statistics
    • Errors per Second
    • Total Errors per Second
  • Transactions
    • Average Transaction Response Time
    • Transactions per Second
    • Total Transactions per Second
    • Transaction Summary
    • Transaction Performance Summary
    • Transaction Response Time Under Load
    • Transaction Response Time (Percentile)
    • Transaction Response Time (Distribution)
    • Transaction Response Time By Location
  • Web Resources
    • Hits per Second
    • Throughput
    • Throughput (MB)
    • HTTP Status Code Summary
    • HTTP Responses per Second
    • Pages Downloaded per Second
    • Retries per Second
    • Retries Summary
    • Connections
    • Connections Per Second
    • SSLs Per Second
  • Web Page Diagnostics
    • Web Page Diagnostics
    • Page Component Breakdown
    • Page Component Breakdown (Over Time)
    • Page Download Time Breakdown
    • Page Download Time Breakdown (Over Time)
    • Time to First Buffer Breakdown
    • Time to First Buffer Breakdown (Over Time)
    • Downloaded Component Size (KB)
    • Client Side Breakdown (Over Time)
    • Client Side JavaScript Breakdown (Over Time)
    • Uploaded Component Size (KB)
  • User Defined Data Points
    • Data Points (Sum)
    • Data Points (Average)
  • System Resources
    • Windows Resources
    • UNIX Resources
    • SNMP Resources
    • SiteScope
    • Host Resources
  • Network Virtualization
    • Average Latency
    • Packet Loss
    • Average Bandwidth Utilization
    • Average Throughput
    • Total Throughput
  • Network Monitor
    • Network Delay Time
    • Network Sub-Path Time
    • Network Segment Delay Time
  • Firewalls
    • Check Point FireWall-1
  • Web Server Resources
    • Apache
    • MS IIS
  • Web Application Server Resources
    • MS Active Server Pages
    • WebLogic (SNMP)
  • Database Server Resources
    • DB2
    • Oracle
    • SQL Server
  • Streaming Media
    • Real Client
    • Real Server
    • Media Player Client
    • Windows Media Server
  • J2EE/.NET Diagnostics
    • J2EE/.NET – Transaction Response Time Server Side
    • J2EE/.NET – Average Method Response Time in Transactions
    • J2EE/.NET – Transactions per Second
    • J2EE/.NET – Method Calls per Second in Transactions
    • J2EE/.NET – Average Number of Exceptions in Transactions
    • J2EE/.NET – Average Number of Timeouts in Transactions
  • J2EE/.NET Server Diagnostics
    • J2EE/.NET – Server Requests Response Time
    • J2EE/.NET – Average Server Method Response Time
    • J2EE/.NET – Server Requests per Second
    • J2EE/.NET – Server Method Calls per Second
    • J2EE/.NET – Average Number of Exceptions on Server
    • J2EE/.NET – Average Number of Timeouts on Server
    • J2EE/.NET – Probes Metrics
  • Application Components
    • COM+ Breakdown
    • COM+ Average Response Time
    • COM+ Call Count
    • COM+ Call Count Distribution
    • COM+ Call Count per Second
    • COM+ Total Operation Time
    • COM+ Total Operation Time Distribution
    • Microsoft COM+
    • .Net Breakdown
    • .Net Average Response Time
    • .Net Call Count
    • .Net Call Count Distribution
    • .Net Call Count per Second
    • .Net Total Operation Time
    • .Net Total Operation Time Distribution
    • .Net Resources
  • Application Deployment Solutions
    • Citrix Server
  • Middleware Performance
    • TUXEDO Resources
    • IBM WebSphere MQ
  • Infrastructure Resource
    • Network Client
  • Topology
    • SiteScope Monitors
  • HP Service Virtualization
    • Operations
    • Services
  • Deprecated
    • Antara FlameThrower Resources
    • iPlanet (SNMP)
    • iPlanet/Netscape
    • Ariba
    • ATG Dynamo
    • BroadVision (4.5-5.4)
    • BroadVision (5.5-6.x)
    • ColdFusion
    • Fujitsu INTERSTAGE
    • iPlanet (NAS)
    • SilverStream
    • WebLogic (JMX)
    • WebSphere 4.5-5.x
    • WebSphere (EPM)
    • Distributed Denial of Service
    • J2EE
    • EJB Breakdown
    • EJB Average Response Time
    • EJB Call Count
    • EJB Call Count Distribution
    • EJB Call Count per Second
    • EJB Total Operation Time
    • EJB Total Operation Time Distribution
    • f5 BIG-IP
    • Server Resources
    • Oracle9iAS HTTP
    • WebSphere
    • WebSphere Application Server
    • Sybase
  • Flex Graphs
    • Average Buffering Time
    • RTMP Connections
    • RTMP Other Statistics
    • Streaming Delivery
    • RTMP Throughput
  • WebSocket Statistics
    • WebSocket Bytes per Second
    • WebSocket Connections per Second
    • WebSocket Messages per Second
  • TruClient Native Mobile
    • CPU Utilization Percentage
    • Free Memory In Device
    • Memory Consumed By The Application

Here are the SQL queries for 29 of the more common graphs…

Vusers: Running Vusers

-- Displays the number of Vusers that executed Vuser scripts, and their status, during 
-- each second of a load test. This graph is useful for determining the Vuser load on 
-- your server at any given moment.
DECLARE @Granularity int;
SET @Granularity = 32;

SELECT 
    Sum([inout flag]) AS [SumAll],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ) AS [Granu],
    [vuser status name]
FROM   
    (vuserevent_meter
        INNER JOIN vuserstatus
            ON ( vuserevent_meter.[vuser status id] = vuserstatus.[vuser status id] ))
WHERE  
    (( [vuser status name] = 'Run' ))
GROUP  BY 
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ),
    [vuser status name]
ORDER  BY 
    [vuser status name],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 );  

Vusers: Vuser Summary

-- Displays the number of Vusers that completed their run successfully, stopped their 
-- run, or ended with errors.
SELECT 
    Count(*) AS [CountAll],
    [vuser end status name]
FROM   
    ((vuserevent_meter
        INNER JOIN vuserendstatus
            ON ( vuserevent_meter.[vuser end status id] = vuserendstatus.[vuser end status id] ))
        INNER JOIN vuserstatus
            ON ( vuserevent_meter.[vuser status id] = vuserstatus.[vuser status id] ))
WHERE  
    (( [vuser status name] = 'Quit' ))
        AND ( ( 1 <= [inout flag] )
        AND ( 1 >= [inout flag] ) )
GROUP  BY 
    [vuser end status name]
ORDER  BY 
    [vuser end status name];

Errors: Error Statistics (by Description)

-- Displays the number of errors that accrued during the load test, grouped by error 
-- code and Error Message.
SELECT 
    Sum([acount]) AS [SumAll],
    [event name],
    [error message]
FROM   
    ((error_meter
        INNER JOIN errormessage
            ON ( error_meter.[error id] = errormessage.[error id] ))
        INNER JOIN event_map
            ON ( error_meter.[event id] = event_map.[event id] ))
WHERE  
    (( [event type] = 'Error' ))
GROUP  BY 
    [event name],
    [error message]
ORDER  BY 
    [event name],
    [error message];
-- note: this is a summary of the entire test, rather than errors over time.

Errors: Errors per Second (by Description)

-- Displays the average number of errors that occurred during each second of the 
-- scenario run, grouped by error code and Error Message.
DECLARE @Granularity int;
SET @Granularity = 32;

SELECT 
    Sum([acount]) / @Granularity AS [SumGAll],
    @Granularity AS [Interval - Acount],
    [describe id] AS [Acount - Describe ID],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ) AS [Granu],
    [event name],
    [error message]
FROM   
    ((error_meter
        INNER JOIN errormessage
            ON ( error_meter.[error id] = errormessage.[error id] ))
        INNER JOIN event_map
            ON ( error_meter.[event id] = event_map.[event id] ))
WHERE  
    (( [event type] = 'Error' ))
GROUP  BY 
    [describe id],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ),
    [event name],
    [error message]
ORDER  BY 
    [event name],
    [error message],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 );

Errors: Error Statistics

-- Displays the number of errors that accrued during the load test, grouped by error code.
SELECT 
    Sum([acount]) AS [SumAll],
    [event name]
FROM   
    (error_meter
        INNER JOIN event_map
            ON ( error_meter.[event id] = event_map.[event id] ))
WHERE  
    (( [event type] = 'Error' ))
GROUP  BY 
    [event name]
ORDER  BY 
    [event name];  

-- note: this is a summary of error *codes* (e.g. "Error -26366") over the entire test.

Errors: Errors per Second

-- Displays the average number of errors that occurred during each second of the 
-- scenario run, grouped by error code.
DECLARE @Granularity int;
SET @Granularity = 32;

SELECT 
    Sum([acount]) / @Granularity AS [SumGAll],
    @Granularity AS [Interval - Acount],
    [describe id] AS [Acount - Describe ID],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ) AS [Granu],
    [event name]
FROM   
    (error_meter
        INNER JOIN event_map
            ON ( error_meter.[event id] = event_map.[event id] ))
WHERE  
    (( [event type] = 'Error' ))
GROUP  BY 
    [describe id],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ),
    [event name]
ORDER  BY 
    [event name],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 );

Errors: Total Errors per Second

-- Displays the average number of errors that occurred during each second of the scenario run.
DECLARE @Granularity int;
SET @Granularity = 32;

SELECT 
    Sum([acount]) / @Granularity AS [SumGAll],
    @Granularity AS [Interval - Acount],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ) AS [Granu]
FROM   
    (error_meter
        INNER JOIN event_map
            ON ( error_meter.[event id] = event_map.[event id] ))
WHERE  
    (( [event type] = 'Error' ))
        AND ( NOT ( ( [event name] LIKE '%:PLAY' )
            OR ( [event name] LIKE '%:BUFFERING' )
            OR ( [event name] LIKE '%:DOWNLOAD' )
            OR ( [event name] LIKE '%:LAG' ) ) )
GROUP  BY 
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 )
ORDER  BY 
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 );  

Transactions: Average Transaction Response Time

-- Displays the average time taken to perform transactions during each second of the 
-- load test. This graph helps you determine whether the performance of the server 
-- is within acceptable minimum and maximum transaction performance time ranges 
-- defined for your system.
DECLARE @Granularity int;
SET @Granularity = 32;

SELECT 
    Sum((( [value] - [think time] )) * ( [acount] )) / Sum([acount]) AS [Response_Time],
    Min(( [value] - [think time] )) AS [Minimum - Response_Time],
    Max(( [value] - [think time] )) AS [Maxsimum - Response_Time],
    Sum([acount]) AS [Count of - Response_Time],
    Sum(( [acount] ) * (( [value] - [think time] )) * (( [value] - [think time] )))  AS [SSqr - Response_Time],
    [describe id] AS [Response_Time - Describe ID],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 )            AS [Granu],
    [event name]
FROM   
    ((event_meter
        INNER JOIN event_map
            ON ( event_meter.[event id] = event_map.[event id] ))
        INNER JOIN transactionendstatus
            ON ( event_meter.[status1] = transactionendstatus.[status1] ))
WHERE  
    (( [event type] = 'Transaction' ))
        AND (( [transaction end status] = 'Pass' ))
        AND ( NOT ( ( [event name] LIKE '%:PLAY' )
            OR ( [event name] LIKE '%:BUFFERING' )
            OR ( [event name] LIKE '%:DOWNLOAD' )
            OR ( [event name] LIKE '%:LAG' ) ) )
GROUP  BY 
    [describe id],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ),
    [event name]
ORDER  BY 
    [event name],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 );  

-- note: interesting spelling of "Maximum"

Transactions: Transactions per Second

-- Displays the number of completed transactions (both successful and unsuccessful) 
-- performed during each second of a load test. This graph helps you determine the 
-- actual transaction load on your system at any given moment.
DECLARE @Granularity int;
SET @Granularity = 32;

SELECT 
    Sum([acount]) / @Granularity AS [SumGAll],
    @Granularity AS [Interval - Acount],
    [describe id] AS [Acount - Describe ID],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ) AS [Granu],
    [event name],
    [transaction end status]
FROM   
    ((event_meter
        INNER JOIN event_map
            ON ( event_meter.[event id] = event_map.[event id] ))
        INNER JOIN transactionendstatus
            ON ( event_meter.[status1] = transactionendstatus.[status1] ))
WHERE  
    (( [event type] = 'Transaction' ))
        AND ( NOT ( ( [event name] LIKE '%:PLAY' )
            OR ( [event name] LIKE '%:BUFFERING' )
            OR ( [event name] LIKE '%:DOWNLOAD' )
            OR ( [event name] LIKE '%:LAG' ) ) )
GROUP  BY 
    [describe id],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ),
    [event name],
    [transaction end status]
ORDER  BY 
    [event name],
    [transaction end status],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 );  
-- note: this will split out passed and failed transactions into separate lines.

Transactions: Total Transactions per Second

-- Displays the total number of completed transactions (both successful and 
-- unsuccessful) performed during each second of a load test. This graph helps 
-- you determine the actual transaction load on your system at any given moment.
DECLARE @Granularity int;
SET @Granularity = 32;

SELECT 
    Sum([acount]) / @Granularity AS [SumGAll],
    @Granularity AS [Interval - Acount],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ) AS [Granu],
    [transaction end status]
FROM
    ((event_meter
        INNER JOIN event_map
            ON ( event_meter.[event id] = event_map.[event id] ))
        INNER JOIN transactionendstatus
            ON ( event_meter.[status1] = transactionendstatus.[status1] ))
WHERE  
    (( [event type] = 'Transaction' ))
GROUP  BY 
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ),
    [transaction end status]
ORDER  BY 
    [transaction end status],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ); 
-- note: this will split out passed and failed transactions into separate lines. 

Transactions: Transaction Summary

-- Displays the number of transactions that passed, failed, stopped, or ended with errors.
SELECT 
    Sum([acount]) AS [CountAll],
    [event name],
    [transaction end status]
FROM
    ((event_meter
        INNER JOIN event_map
            ON ( event_meter.[event id] = event_map.[event id] ))
        INNER JOIN transactionendstatus
            ON ( event_meter.[status1] = transactionendstatus.[status1] ))
WHERE  
    (( [event type] = 'Transaction' ))
        AND ( NOT ( ( [event name] LIKE '%:PLAY' )
            OR ( [event name] LIKE '%:BUFFERING' )
            OR ( [event name] LIKE '%:DOWNLOAD' )
            OR ( [event name] LIKE '%:LAG' ) ) )
GROUP  BY 
    [event name],
    [transaction end status]
ORDER  BY 
    [event name],
    [transaction end status];  
-- note: broken down by transaction name and transaction end status.

Transactions: Transaction Performance Summary

-- Displays the minimum, average, and maximum response time for all the 
-- transactions in the load test.
SELECT 
    Min(( [aminimum] - [think time] )) AS [Minimum],
    Sum((( [value] - [think time] )) * ( [acount] )) / Sum([acount]) AS [Average],
    Sum([acount]) AS [Count of - Average],
    Max(( [amaximum] - [think time] )) AS [Maximum],
    [event name]
FROM   
    ((event_meter
        INNER JOIN event_map
            ON ( event_meter.[event id] = event_map.[event id] ))
        INNER JOIN transactionendstatus
            ON ( event_meter.[status1] = transactionendstatus.[status1] ))
WHERE  
    (( [event type] = 'Transaction' ))
        AND (( [transaction end status] = 'Pass' ))
        AND ( NOT ( ( [event name] LIKE '%:PLAY' )
            OR ( [event name] LIKE '%:BUFFERING' )
            OR ( [event name] LIKE '%:DOWNLOAD' )
            OR ( [event name] LIKE '%:LAG' ) ) )
GROUP  BY 
    [event name]
ORDER  BY 
    [event name];

Transactions: Transaction Response Time Under Load

-- Displays average transaction response times relative to the number of Vusers 
-- running at any given point during the load test. This graph helps you view the 
-- general impact of Vuser load on performance time and is most useful when 
-- analyzing a load test which is run with a gradual load.

-- note: skipped. Looks complicated.

Transactions: Transaction Response Time (Percentile)

-- Displays the percentage of transactions that were performed within a given time 
-- range. This graph helps you determine the percentage of transactions that meet 
-- the performance criteria defined for your system.

-- note: This looks a little complicated too. 
-- It is interesting that this SQL query does not use the BasicTransactionPercentile table.

Transactions: Transaction Response Time (Distribution)

-- Displays the number of times a transaction was completed over a distribution of 
-- time ranges. Note that this graph only displays information for a single transaction 
-- at a time.
SELECT 
    Sum([acount]) AS [SumAll],
    ( ( ( Floor(( Round([value], 3) - 0 ) / 1) ) * 1 ) + 0 ) AS [Granu],
    [event name]
FROM   
    ((event_meter
        INNER JOIN event_map
            ON ( event_meter.[event id] = event_map.[event id] ))
        INNER JOIN transactionendstatus
            ON ( event_meter.[status1] = transactionendstatus.[status1] ))
WHERE  
    (( [event type] = 'Transaction' ))
        AND (( [transaction end status] = 'Pass' ))
        AND ( NOT ( ( [event name] LIKE '%:PLAY' )
            OR ( [event name] LIKE '%:BUFFERING' )
            OR ( [event name] LIKE '%:DOWNLOAD' )
            OR ( [event name] LIKE '%:LAG' ) ) )
GROUP  BY 
    ( ( ( Floor(( Round([value], 3) - 0 ) / 1) ) * 1 ) + 0 ),
    [event name]
ORDER  BY 
    [event name],
    ( ( ( Floor(( Round([value], 3) - 0 ) / 1) ) * 1 ) + 0 );

Transactions: Transaction Response Time By Location

-- This graph indicates the transaction response times relative to the virtual 
-- locations in which they were performed.

-- note: this requires HP Network Virtualization to be installed on the load generators.

Web Resources: Hits per Second

-- Displays the number of hits made on the Web server by Vusers during each second 
-- of the load test. This graph helps you evaluate the amount of load Vusers generate, 
-- in terms of the number of hits.
DECLARE @Granularity int;
SET @Granularity = 32;

DECLARE @ThroughputEventID int;
SET @ThroughputEventID = (SELECT [Event ID] FROM Event_map WHERE [Event Name] = 'Throughput');

SELECT 
    Sum([value] * [acount]) / @Granularity AS [SumGAll],
    @Granularity AS [Interval - Value],
    [describe id] AS [Value - Describe ID],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ) AS [Granu],
    'Hits' AS EventName
FROM   
    (webevent_meter
        INNER JOIN event_map
            ON ( webevent_meter.[event id] = event_map.[event id] ))
WHERE  
    ( [webevent_meter].[event id] <> @ThroughputEventID )
GROUP  BY 
    [describe id],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 )
ORDER  BY 
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 );  

-- note: They already did an INNER JOIN to event_map. Why not use [Event name] instead of [Event ID] in the WHERE clause?

Web Resources: Throughput

-- Displays the amount of throughput (in bytes) on the Web server during the load 
-- test. Throughput represents the amount of data that the Vusers received from the 
-- server at any given second. This graph helps you to evaluate the amount of load 
-- Vusers generate, in terms of server throughput.
DECLARE @Granularity int;
SET @Granularity = 32;

DECLARE @ThroughputEventID int;
SET @ThroughputEventID = (SELECT [Event ID] FROM Event_map WHERE [Event Name] = 'Throughput');

SELECT 
    Sum([value] * [acount]) / @Granularity AS [SumGAll],
    256 AS [Interval - Value],
    [describe id] AS [Value - Describe ID],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ) AS [Granu],
    'Throughput' AS EventName
FROM   
    (webevent_meter
        INNER JOIN event_map
            ON ( webevent_meter.[event id] = event_map.[event id] ))
WHERE  
    ( [webevent_meter].[event id] = @ThroughputEventID )
GROUP  BY 
    [describe id],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 )
ORDER  BY 
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 );

-- note: very similar to "Hits per Second", except this time we want 'Throughput' events, not '<>Throughput' events.

Web Resources: Throughput (MB)

-- Displays the amount of throughput (in megabytes) on the Web server during the load 
-- test. Throughput represents the amount of data that the Vusers received from the 
-- server at any given second. This graph helps you to evaluate the amount of load 
-- Vusers generate, in terms of server throughput.
DECLARE @Granularity int;
SET @Granularity = 32;

DECLARE @ThroughputEventID int;
SET @ThroughputEventID = (SELECT [Event ID] FROM Event_map WHERE [Event Name] = 'Throughput');

 SELECT 
    Sum([value] / 1024 / 1024 * [acount]) / 256 AS [SumGAll],
    @Granularity AS [Interval - Value/1024/1024],
    [describe id] AS [Value/1024/1024 - Describe ID],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ) AS [Granu],
    'Throughput' AS EventName
FROM
    (webevent_meter
        INNER JOIN event_map
            ON ( webevent_meter.[event id] = event_map.[event id] ))
WHERE
    ( [webevent_meter].[event id] = @ThroughputEventID )
GROUP  BY
    [describe id],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 )
ORDER  BY 
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 );  

-- note: The SQL query for 'Throughput (MB)' is the same as 'Throughput', except divided twice by 1024. I am not sure how this is different to being divided once by 1,048,576. Maybe it is a readability thing.

Web Resources: HTTP Status Code Summary

-- Displays the distribution of the various HTTP protocol status codes returned from 
-- the Web Server during the load test.
SELECT 
    Sum([value] * [acount]) AS [SumAll],
    [event name]
FROM
    (webevent_meter
        INNER JOIN event_map
            ON ( webevent_meter.[event id] = event_map.[event id] ))
WHERE  
    (( [event type] = 'Web' ))
        AND ( NOT ( ( [event name] = 'Hits' )
            OR ( [event name] = 'Throughput' ) ) )
GROUP  BY 
    [event name]
ORDER  BY 
    [event name];  

Web Resources: HTTP Responses per Second

-- Displays the number of the different HTTP status codes returned from the Web 
-- server during each second of the load test.
DECLARE @Granularity int;
SET @Granularity = 32;

SELECT 
    Sum([value] * [acount]) / @Granularity AS [SumGAll],
    @Granularity AS [Interval - Value],
    [describe id] AS [Value - Describe ID],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ) AS [Granu],
    [event name]
FROM
    (webevent_meter
        INNER JOIN event_map
            ON ( webevent_meter.[event id] = event_map.[event id] ))
WHERE  
    (( [event type] = 'Web' ))
        AND ( NOT ( ( [event name] = 'Hits' )
            OR ( [event name] = 'Throughput' ) ) )
GROUP  BY 
    [describe id],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ),
    [event name]
ORDER  BY 
    [event name],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 );  

Web Resources: Pages Downloaded per Second

-- Displays the number of pages received from the Web server during the load test.
DECLARE @Granularity int;
SET @Granularity = 32;

SELECT 
    Sum([value] * [acount]) / @Granularity AS [SumGAll],
    @Granularity AS [Interval - Value],
    [describe id] AS [Value - Describe ID],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ) AS [Granu],
    [event name]
FROM   
    (datapoint_meter
        INNER JOIN event_map
            ON ( datapoint_meter.[event id] = event_map.[event id] ))
WHERE  
    (( [event type] = 'PageV' ))
GROUP  BY 
    [describe id],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ),
    [event name]
ORDER  BY 
    [event name],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 );

Web Resources: Retries per Second

-- Displays the number of attempted server connections during each second of the 
-- scenario run. A server connection is retried when the initial connection was 
-- unauthorized, when proxy authentication is required, when the initial connection 
-- was closed by the server, when the initial connection to the server could not be 
-- made, or when the server was initially unable to resolve the load generator's IP address.
DECLARE @Granularity int;
SET @Granularity = 32;

 SELECT 
    Sum([value] * [acount]) / @Granularity AS [SumGAll],
    @Granularity AS [Interval - Value],
    [describe id] AS [Value - Describe ID],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ) AS [Granu],
    [event name]
FROM   
    (datapoint_meter
        INNER JOIN event_map
            ON ( datapoint_meter.[event id] = event_map.[event id] ))
WHERE  
    (( [event type] = 'Retry' ))
GROUP  BY 
    [describe id],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ),
    [event name]
ORDER  BY 
    [event name],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 );  

Web Resources: Retries Summary

-- Shows the number of attempted server connections during the scenario run, grouped 
-- by the cause of the retry. Use this graph together with the Retries per Second 
-- Graph to determine at what point during the scenario the server retries were attempted.
SELECT 
    Sum([value] * [acount]) AS [SumAll],
    [event name]
FROM   
    (datapoint_meter
        INNER JOIN event_map
            ON ( datapoint_meter.[event id] = event_map.[event id] ))
WHERE  
    (( [event type] = 'Retry' ))
GROUP  BY 
    [event name]
ORDER  BY 
    [event name];

Web Resources: Connections

-- Displays the number of Connections
DECLARE @Granularity int;
SET @Granularity = 32;

SELECT 
    Sum([value] * [acount]) AS [SumAll],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ) AS [Granu],
    [event name]
FROM   
    (datapoint_meter
        INNER JOIN event_map
            ON ( datapoint_meter.[event id] = event_map.[event id] ))
WHERE  
    (( [event type] = 'Connections' ))
GROUP  BY 
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ),
    [event name]
ORDER  BY 
    [event name],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 );  

Web Resources: Connections Per Second

-- Displays the number of Connections per Second
DECLARE @Granularity int;
SET @Granularity = 32;

SELECT 
    Sum([value] * [acount]) / @Granularity AS [SumGAll],
    @Granularity AS [Interval - Value],
    [describe id] AS [Value - Describe ID],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ) AS [Granu],
    [event name]
FROM   
    (datapoint_meter
        INNER JOIN event_map
            ON ( datapoint_meter.[event id] = event_map.[event id] ))
WHERE  
    (( [event type] = 'Connections per Second' ))
GROUP  BY 
    [describe id],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ),
    [event name]
ORDER  BY 
    [event name],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 );  

System Resources: SiteScope

-- Displays measurements reported by SiteScope.
DECLARE @Granularity int;
SET @Granularity = 32;

SELECT 
    Sum(( [value] ) * ( [acount] )) / Sum([acount]) AS [AvgAll],
    Min([aminimum]) AS [Minimum - Value],
    Max([amaximum]) AS [Maximum - Value],
    Sum([acount]) AS [Count of - Value],
    Sum([asumsq]) AS [SSqr - Value],
    [describe id] AS [Value - Describe ID],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ) AS [Granu],
    [event name],
    [host name]
FROM   
    ((monitor_meter
      INNER JOIN event_map
          ON ( monitor_meter.[event id] = event_map.[event id] ))
      INNER JOIN host
          ON ( monitor_meter.[host id] = host.[host id] ))
WHERE
    (( [event type] = 'SiteScope' ))
GROUP  BY 
    [describe id],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ),
    [event name],
    [host name]
ORDER  BY 
    [event name],
    [host name],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 );  

System Resources: Host Resources

-- Displays a summary of the System Resources usage for each Windows based 
-- Performance Center host (Controller and Load Generators).
DECLARE @Granularity int;
SET @Granularity = 32;

SELECT 
    Sum(( [value] ) * ( [acount] )) / Sum([acount]) AS [AvgAll],
    Min([aminimum]) AS [Minimum - Value],
    Max([amaximum]) AS [Maximum - Value],
    Sum([acount]) AS [Count of - Value],
    Sum([asumsq]) AS [SSqr - Value],
    [describe id] AS [Value - Describe ID],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ) AS [Granu],
    [event name],
    [host name]
FROM
    ((monitor_meter
      INNER JOIN event_map
          ON ( monitor_meter.[event id] = event_map.[event id] ))
      INNER JOIN host
          ON ( monitor_meter.[host id] = host.[host id] ))
WHERE
    (( [event type] = 'Hosts - Utilization' ))
GROUP  BY
    [describe id],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 ),
    [event name],
    [host name]
ORDER  BY 
    [event name],
    [host name],
    ( ( ( Floor(( [end time] - 0 ) / @Granularity) ) * @Granularity ) + 0 );
-- note: this is basically the same as the query for the SiteScope graph, just with a different [event type].

And here are some additional queries from the Analysis Summary report.

Period

SELECT 
    CONVERT(VARCHAR, Dateadd(second, [start time] - [Time Zone], '1970-01-01'), 121) AS [Start Time],
    CONVERT(VARCHAR, Dateadd(second, [result end time] - [Time Zone], '1970-01-01'), 121) AS [End Time]
FROM
    result;

-- note: instead of "17/06/2015 14:06:50 - 17/06/2015 16:43:35", this outputs "2015-06-17 14:06:50.000" and "2015-06-17 16:43:35.000"

Scenario Name

SELECT 
    [scenario name]
FROM
    result;

Results in Session
SELECT 
    [result name]
FROM
    result; 
-- note: this gives the name of the *.lrr file. I am not sure where the path is coming from.

Duration

SELECT 
    CONVERT(VARCHAR, 
           ( Dateadd(second, [result end time], '1970-01-01') - Dateadd(second, [start time], '1970-01-01') ),
             108)
FROM
    result; 
-- note: this returns "02:36:45", instead of "2 hours, 36 minutes and 45 seconds."

Did you find this blog post useful? Have you written your own SQL queries for the LoadRunner Analysis database? Please share your experiences in the comments below.

 

Published On: December 8, 2016Tags: ,

2 Comments

  1. Anon December 9, 2016 at 6:44 am

    Are the queries for MS Access, SQL Server, or SQLite?

    • Stuart Moncrieff December 9, 2016 at 11:58 am

      The queries in my blog post are for SQL Server. There should be some minor syntax differences between the three LoadRunner Analysis database options (MS Access, SQL Server, SQLite), but nothing you won’t be able to figure out with minimal googling.

      The best way to see the SQL queries executed by LoadRunner Analysis is to change the database type from MS Access to SQL Server (In LoadRunner Analysis, select Tools > Options > Database). Running a trace with the SQL Server Profiler will show the queries that are run when you open each new graph type.

Comments are closed.