-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
60 lines (59 loc) · 17.4 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>WorkloadRunner Documentation</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"/></head><body><div class="book"><div class="titlepage"><div><div><h1 class="title"><a id="d53e1"/>WorkloadRunner Documentation</h1></div><div><div class="author"><h3 class="author"><span class="firstname">Radim</span> <span class="surname">Bača</span></h3></div></div></div><hr/></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="preface"><a href="#d53e10">Introduction</a></span></dt><dt><span class="chapter"><a href="#d53e15">1. Command Line Parameters</a></span></dt><dt><span class="chapter"><a href="#d53e47">2. Format of the Input XML file</a></span></dt><dd><dl><dt><span class="section"><a href="#d53e62">Configuration (<conf> element)</a></span></dt><dd><dl><dt><span class="section"><a href="#d53e77">Warm-up</a></span></dt><dt><span class="section"><a href="#d53e91">Specifying the Measurement</a></span></dt><dt><span class="section"><a href="#d53e114">Specifying the format of an output XML file</a></span></dt></dl></dd><dt><span class="section"><a href="#d53e130">SQL Command (<sql> element)</a></span></dt><dd><dl><dt><span class="section"><a href="#d53e159">SQL Command Types</a></span></dt></dl></dd><dt><span class="section"><a href="#d53e189">Session (<session> element)</a></span></dt></dl></dd><dt><span class="chapter"><a href="#d53e199">3. Format of the Output XML file</a></span></dt><dd><dl><dt><span class="section"><a href="#d53e214">Errors and warnings</a></span></dt></dl></dd></dl></div><div class="list-of-examples"><p><strong>List of Examples</strong></p><dl><dt>1.1. <a href="#d53e42">Using the WorkloadRunner.jar</a></dt><dt>2.1. <a href="#d53e125">Configuration</a></dt><dt>2.2. <a href="#d53e184">SQL commands</a></dt><dt>2.3. <a href="#d53e194">Session</a></dt><dt>3.1. <a href="#d53e229">Wrong connection credetials</a></dt></dl></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a id="d53e10"/>Introduction</h1></div></div></div><p>This is a documentation of a XML file format that is consumed by the WorkladRunner application. The WorkloadRunner application is internaly used by ShepherdDB, therefore, the XML file format is required by ShepherdDB as well.</p></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="d53e15"/>Chapter 1. Command Line Parameters</h1></div></div></div><p>In order to run the WorkloadRunner application you need to prepare a database and load a data into the database. The application is bundled in a workloadrunner.jar file. There are seven arguments that has to be passed to the application:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>0/1 - type of an application. 0 - stands for a plain SQL file, 1 - for an XML file</p></li><li class="listitem"><p>Input.xml - an existing file with input workload</p></li><li class="listitem"><p>Output.xml - where the result will be serialized</p></li><li class="listitem"><p>Instance - usually a hostname\instanceName which specify a database system</p></li><li class="listitem"><p>Dbname - name of the database with data</p></li><li class="listitem"><p>UserName - name of an existing database user with access to the database</p></li><li class="listitem"><p>Password - password of the user</p></li></ul></div><div class="example"><a id="d53e42"/><p class="title"><strong>Example 1.1. Using the WorkloadRunner.jar</strong></p><div class="example-contents"><p>java -jar WorkLoadRunner.jar 1 input.xml output.xml 158.196.98.17\ADBS DBname radim pass</p></div></div><br class="example-break"/></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="d53e47"/>Chapter 2. Format of the Input XML file</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="#d53e62">Configuration (<conf> element)</a></span></dt><dd><dl><dt><span class="section"><a href="#d53e77">Warm-up</a></span></dt><dt><span class="section"><a href="#d53e91">Specifying the Measurement</a></span></dt><dt><span class="section"><a href="#d53e114">Specifying the format of an output XML file</a></span></dt></dl></dd><dt><span class="section"><a href="#d53e130">SQL Command (<sql> element)</a></span></dt><dd><dl><dt><span class="section"><a href="#d53e159">SQL Command Types</a></span></dt></dl></dd><dt><span class="section"><a href="#d53e189">Session (<session> element)</a></span></dt></dl></div><p>The root XML element has to have a name "workload". There are three possible child elements of <workload></p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><conf> - there can be just one such element in the whole XML document. It contains a configuration that specifies what to run, how to measure and what to return.</p></li><li class="listitem"><p><sql> - there can be many <sql> elements under the workload element. One element specifies one SQL command.</p></li><li class="listitem"><p><session> - there can be many <session> elements under the <workload> element. One <session> element represents a workload produced by a single session.</p></li></ul></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="d53e62"/>Configuration (<conf> element)</h2></div></div></div><p>The configuration contains three types of child elements:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>Warm-up - How to perform a warm-up before the application starts. (<warm_up> element)</p></li><li class="listitem"><p>Specifying the measurement - whether to run defined sessions or ignore them and run single SQL commands without any mutual continuity. We need to also define how many times repeat each SQL command and which types of SQL commands to perform. (<perform>, <repeat>, <order_of_commands>, <command_type> elements)</p></li><li class="listitem"><p>Specifying the format of an output XML file - we can specify values that should be part of the output. (<time_for_each_statement>, <omit_cost> elements)</p></li></ul></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="d53e77"/>Warm-up</h3></div></div></div><p>We usually want to warm-up the cache before we start measuring the time of each SQL command. For that purpose we use the <warm_up> element. This element can have two attributes that specify which SQL commands should be performed during the warm-up:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>run_all_sessions - If this attribute is present WorkloadRunner runs all sessions</p></li><li class="listitem"><p>randomly_select='Num' - WorkloadRunner randomly selects Num SQL commands</p></li></ul></div><p>Of course, none of the SQL commands performed during the warm-up is measured, therefore, it is not included in the final statistics.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="d53e91"/>Specifying the Measurement</h3></div></div></div><p>The <perform> element defines a mode for SQL command time measurements. There are two possible values:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>"commands" - the application randomly select the SQL commands.</p></li><li class="listitem"><p>"sessions" - the application in the session mode runs parallel threads simulating the workload specified in sessions.</p></li></ul></div><p>The <repeat> element contains a number from the interval <1,20>. The number specifies how many times each SQL query is repeated. If we use a sessions mode than this value specifies how many times each session is repeated. The implicit value is 1. Note that this value is related only to SQL queries since other SQL commands cannot be performed arbitrary number of times.</p><p>If the application runs in commands mode, we can influence several other details:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>The <order_of_commands> element specify whether each SQL commands should be performed randomly or in the order of XML document. There are two values: (1) "random", and (2) "sequential". The random value is default.</p></li><li class="listitem"><p>The <command_type>SQL command type</command_type> defines SQL command types that should be performed. The SQL command types are defined in SQL command section. During the commands mode the application runs just SQL queries, since the remaining types of SQL commands are usually non-repeatable.</p></li></ul></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="d53e114"/>Specifying the format of an output XML file</h3></div></div></div><p>There are just two types of information in the output XML file: (1) the errors and warnings, and (2) the cost of workload. However, something can be removed or added.</p><p>The <time_for_each_statement> element defines that the output XML file has to contain average processing time for each SQL command.
</p><p>The <omit_cost> element defines that the cost of workload will not be included in the output XML file. It can be useful if we are interested only in the workload correctness.
</p></div><div class="example"><a id="d53e125"/><p class="title"><strong>Example 2.1. Configuration</strong></p><div class="example-contents"><pre class="programlisting">
<conf>
<warm_up randomly_select='100'/>
<perform>commands</perform>
<repeat>5</repeat>
<order_of_commands>random</order_of_commands>
</conf>
</pre></div></div><br class="example-break"/></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="d53e130"/>SQL Command (<sql> element)</h2></div></div></div><p>The <sql> element represents an SQL command that can be evaluated by WorkloadRunner. The <sql> element is a general parametrized form of an SQL command. There can be more than one parameter values corresponding to one SQL command. SQL command with concrete paremeter values. The values of parameters of one SQL command are stored in one <values> element that is a child of the <sql> element. Each <sql> element can have zero or many <values> elements. The <values> element contains a set of <p> elements where each <p> element contains one value of a parameter.</p><p>There is a number of different attributes that has to be specified for each SQL command:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>id - specifies an unique number of the SQL command.</p></li><li class="listitem"><p>text - textual form of the SQL command. The text contains a questionmark instead of each parameter value.</p></li><li class="listitem"><p>paramcount - number of parameters in the text. This value has to correspond to the number of questionmarks in the SQL command text.</p></li><li class="listitem"><p>count - represents an importance of the SQL command. Ussualy it corresponds to a frequency of occurences in the original workload.</p></li><li class="listitem"><p>type - specifies a type of the SQL command. List of possible values of this attribute can be found in the following text.</p></li><li class="listitem"><p>parameterized - statistical information.</p></li><li class="listitem"><p>unparameterized - statistical information.</p></li></ul></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="d53e159"/>SQL Command Types</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>DQL - SQL query (SELECT statement)</p></li><li class="listitem"><p>DML - Data modification language (INSERT, UPDATE, DELETE)</p></li><li class="listitem"><p>DDL - Data definition language (CREATE TABLE, CREATE INDEX and so on)</p></li><li class="listitem"><p>TCL - Transaction control language (Configuration SQL commands)</p></li><li class="listitem"><p>ROLLBACK</p></li><li class="listitem"><p>COMMIT</p></li><li class="listitem"><p>PROCEDURE</p></li></ul></div></div><div class="example"><a id="d53e184"/><p class="title"><strong>Example 2.2. SQL commands</strong></p><div class="example-contents"><pre class="programlisting">
<sql id="1" text=" set transaction isolation level read committed set implicit_transactions off set transaction isolation level read committed set implicit_transactions off " paramcount="0" count="10" type="TCL" parameterized="0" unparameterized="10" />
<sql id="2" text="Select * From uzivatel Where id = ?" paramcount="1" count="10" type="DQL" parameterized="10" unparameterized="0">
<values count="2">
<p>58916</p>
</values>
<values count="5">
<p>48738</p>
</values>
<values count="2">
<p>13125</p>
</values>
<values count="1">
<p>17510</p>
</values>
</sql>
</pre></div></div><br class="example-break"/></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="d53e189"/>Session (<session> element)</h2></div></div></div><p>Session is a sequence of SQL commands (statements). The <session> element contains a set of <statement> elements. Each <statement> has an 'id' attribute that reference the SQL command. The second parameter is a 'param' attribute that speficies the parameter values. In other words, 'param' attribute value specifies order of the 'values' element in the <sql> element.
</p><div class="example"><a id="d53e194"/><p class="title"><strong>Example 2.3. Session</strong></p><div class="example-contents"><pre class="programlisting">
<Session startat="00:00:00">
<statement id="1" param="0" startat="00:00:2.300" />
<statement id="2" param="1" startat="00:00:3.850" />
<statement id="2" param="3" startat="00:00:5.880" />
</Session>
<Session startat="00:00:10">
<statement id="1" param="0" startat="00:00:0.450" />
<statement id="2" param="2" startat="00:00:2.150" />
<statement id="2" param="4" startat="00:00:3.830" />
</Session>
</pre></div></div><br class="example-break"/></div></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="d53e199"/>Chapter 3. Format of the Output XML file</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="#d53e214">Errors and warnings</a></span></dt></dl></div><p>Format of the output XML file is partly influenced by the configuration specified in the input XML file. The name of a root element is 'response'. There are three types of children of the root:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>errors - each error or warning is included as an child element.</p></li><li class="listitem"><p>sql statistics - if the input XML file configuration contains <time_for_each_statement> than the output XML file contains statistics for each SQL command.</p></li><li class="listitem"><p>cost - cost of the workload.</p></li></ul></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="d53e214"/>Errors and warnings</h2></div></div></div><p>Each error or warning captured has its own element. There are three possible element names:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>error - this element ussually corresponds to exceptions that occur during an SQL command processing.</p></li><li class="listitem"><p>severe_error - this element corresponds to errors such as non existing input XML file, wrong format of the input XML file, or wrong connection credentials.</p></li><li class="listitem"><p>warning - this element contains warnings related to some inaccuracies in the input XML file configuration or it contains SQL command warnings.</p></li></ul></div><div class="example"><a id="d53e229"/><p class="title"><strong>Example 3.1. Wrong connection credetials</strong></p><div class="example-contents"><pre class="programlisting">
<response>
<severe_error>
<message>There was an error when connecting to the database. Please check your connection credentials.</message>
</severe_error>
<error>
<message>data\MyInput.xml there was na error in thread. Statistics may be incomplete, please run the workload again.</message>
</error>
<severe_error>
<message>There was an error when connecting to the database. Please check your connection credentials.</message>
</severe_error>
<error>
<message>data\MyInput.xml there was na error in thread. Statistics may be incomplete, please run the workload again.</message>
</error>
<cost>NaN</cost>
</response>
</pre></div></div><br class="example-break"/></div></div></div></body></html>