Merge pull request #505 from v-kaywon/perf_change_iter

Perf change iter
This commit is contained in:
Yuki Wong 2017-08-23 11:36:51 -07:00 committed by GitHub
commit 3cee2d400b
23 changed files with 461 additions and 240 deletions

View file

@ -23,19 +23,17 @@ Run `Windows PowerShell` as administrator.
PHPBench is used to run the benchmarks. Visit http://phpbench.readthedocs.io/en/latest/introduction.html to have an idea how the tool works.
##### 1. Modify lib/connect.php with the test database credentials
##### 2. Execute run-perf_tests.py
##### 2. Modify lib/result_db.php with the result database credentials
##### 3. The number of iterations for each test can be modified in the test itself (e.g., in test/Performance/benchmark/sqlsrv/SqlsrvSelectVersionBench.php). Each bench class in a test, or the parent class that it extends from, has a @Iteration(n) annotation. If you change the number in this annotation, you will change the number of iterations run for this test. By default, most tests are set to 1000 iterations.
##### 4. Execute run-perf_tests.py.
### Windows
py.exe run-perf_tests.py -platform <PLATFORM> -iterations <ITERATIONS> -iterations-large <ITERATIONS_LARGE> -result-server <RESULT_SERVER> -result-db <RESULT_DB> -result-uid <RESULT_UID> -result-pwd <RESULT_PWD
py.exe run-perf_tests.py -platform <PLATFORM>
### Linux and Mac
On Linux and Mac, the script must be executed with `sudo python3` because to enable pooling it needs to modify odbcinst.ini system file. As an improvement, the location of the odbcinst.ini file can be changed so that, sudo is not requiered.
python3 run-perf_tests.py -platform <PLATFORM> -iterations <ITERATIONS> -iterations-large <ITERATIONS_LARGE> -result-server <RESULT_SERVER> -result-db <RESULT_DB> -result-uid <RESULT_UID> -result-pwd <RESULT_PWD>
python3 run-perf_tests.py -platform <PLATFORM> | tee run-perf_output.txt
`-platform` - The platform that the tests are ran on. Must be one of the following: Windows10, WindowsServer2016, WindowsServer2012, Ubuntu16, RedHat7, Sierra.
`-iterations` - The number of iterations for regular tests.
`-iterations-large` - The number of iterations for the tests that fetch large data. Usually set to 1.
`-result-server` - The server containing the result database. It is assumed that the result database s already setup before running the tests.
`-result-db` - Database name. With the current result database setup files, this should be set to `TestResults`.
`-result-uid` - Result database username.
`-result-pwd` - Result database password.
`-php-driver` (optional) - The driver that the tests are ran on. Must be one of the following: sqlsrv, pdo_sqlsrv, or both. Default is both.
`-testname` (optional) - The test to run. Must be the file name (not including path) of one test or 'all'. Default is 'all'. If one test is specified, must also specify the -php-driver option to sqlsrv or pdo_sqlsrv.

View file

@ -1,12 +1,15 @@
<?php
use PDOSqlsrvPerfTest\PDOSqlsrvUtil;
include_once __DIR__ . "/../../lib/CRUDBaseBenchmark.php";
class PDOConnectionBench{
class PDOConnectionBench extends CRUDBaseBenchmark
{
/*
* Opens a connection and closes it immediately
*/
public function benchConnectAndDisconnect(){
public function benchConnectAndDisconnect()
{
$conn = PDOSqlsrvUtil::connect();
PDOSqlsrvUtil::disconnect( $conn );
}

View file

@ -1,21 +1,25 @@
<?php
use PDOSqlsrvPerfTest\PDOSqlsrvUtil;
include_once __DIR__ . "/../../lib/CRUDBaseBenchmark.php";
/**
* @BeforeMethods({"connect"})
* @AfterMethods({"disconnect"})
*/
class PDOCreateDbTableProcBench{
class PDOCreateDbTableProcBench extends CRUDBaseBenchmark
{
private $conn;
public function connect(){
public function connect()
{
$this->conn = PDOSqlsrvUtil::connect();
}
/*
* Each iteration creates a database, a table and a stored procedure in that database and drops the database at the end.
* Note that, execDirect function are used to execute all the queries.
*/
public function benchCreateDbTableProc(){
public function benchCreateDbTableProc()
{
$randomNum = rand();
$databaseName = "test_db_$randomNum";
$tableName = "test_table_$randomNum";
@ -24,7 +28,8 @@ class PDOCreateDbTableProcBench{
PDOSqlsrvUtil::dropDatabase( $this->conn, $databaseName );
}
public function disconnect(){
public function disconnect()
{
PDOSqlsrvUtil::disconnect( $this->conn );
}
}

View file

@ -1,34 +1,42 @@
<?php
use PDOSqlsrvPerfTest\PDOSqlsrvUtil;
include_once __DIR__ . "/../../lib/CRUDBaseBenchmark.php";
/**
* @BeforeMethods({"connect", "setTableName", "createTable", "generateInsertValues", "insertWithPrepare"})
* @AfterMethods({ "dropTable","disconnect"})
*/
class PDODeleteBench{
class PDODeleteBench extends CRUDBaseBenchmark
{
private $conn;
private $tableName;
private $insertValues;
public function setTableName(){
public function setTableName()
{
$this->tableName = "datatypes_".rand();
}
public function connect(){
public function connect()
{
$this->conn = PDOSqlsrvUtil::connect();
}
public function createTable(){
public function createTable()
{
PDOSqlsrvUtil::createCRUDTable( $this->conn, $this->tableName );
}
public function generateInsertValues(){
public function generateInsertValues()
{
$this->insertValues = PDOSqlsrvUtil::generateInsertValues();
}
public function insertWithPrepare(){
for( $i=0; $i<1000; $i++ ){
public function insertWithPrepare()
{
for( $i=0; $i<PDOSqlsrvUtil::$loopsPerCRUDIter; $i++ )
{
PDOSqlsrvUtil::insertWithPrepare( $this->conn, $this->tableName, $this->insertValues );
}
}
@ -36,17 +44,21 @@ class PDODeleteBench{
* Each iteration inserts 1000 rows into the table, benchDelete deletes top row from the table 1000 times.
* Note that, every delete calls prepare and execute APIs.
*/
public function benchDelete(){
for( $i=0; $i<1000; $i++ ){
public function benchDelete()
{
for( $i=0; $i<PDOSqlsrvUtil::$loopsPerCRUDIter; $i++ )
{
PDOSqlsrvUtil::deleteWithPrepare( $this->conn, $this->tableName );
}
}
public function dropTable(){
public function dropTable()
{
PDOSqlsrvUtil::dropTable( $this->conn, $this->tableName );
}
public function disconnect(){
public function disconnect()
{
PDOSqlsrvUtil::disconnect( $this->conn );
}

View file

@ -1,32 +1,39 @@
<?php
use PDOSqlsrvPerfTest\PDOSqlsrvUtil;
include_once __DIR__ . "/../../lib/CRUDBaseBenchmark.php";
/**
* @BeforeMethods({"connect", "setTableName", "createTable", "generateInsertValues", "insertWithPrepare"})
* @AfterMethods({"dropTable", "disconnect"})
*/
class PDOFetchBench{
class PDOFetchBench extends CRUDBaseBenchmark
{
private $conn;
private $tableName;
private $insertValues;
public function setTableName(){
public function setTableName()
{
$this->tableName = "datatypes_".rand();
}
public function connect(){
public function connect()
{
$this->conn = PDOSqlsrvUtil::connect();
}
public function createTable(){
public function createTable()
{
PDOSqlsrvUtil::createCRUDTable( $this->conn, $this->tableName );
}
public function generateInsertValues(){
public function generateInsertValues()
{
$this->insertValues = PDOSqlsrvUtil::generateInsertValues();
}
public function insertWithPrepare(){
public function insertWithPrepare()
{
PDOSqlsrvUtil::insertWithPrepare( $this->conn, $this->tableName, $this->insertValues );
}
@ -34,17 +41,21 @@ class PDOFetchBench{
* Each iteration inserts a row into the table, benchFetchWithPrepare() fetches that row 1000 times.
* Note that, every fetch calls prepare, execute and fetch APIs.
*/
public function benchFetchWithPrepare(){
for( $i=0; $i<1000; $i++){
public function benchFetchWithPrepare()
{
for( $i=0; $i<PDOSqlsrvUtil::$loopsPerCRUDIter; $i++)
{
PDOSqlsrvUtil::fetchWithPrepare( $this->conn, $this->tableName );
}
}
public function dropTable(){
public function dropTable()
{
PDOSqlsrvUtil::dropTable( $this->conn, $this->tableName );
}
public function disconnect(){
public function disconnect()
{
PDOSqlsrvUtil::disconnect( $this->conn );
}
}

View file

@ -2,30 +2,36 @@
use PDOSqlsrvPerfTest\PDOSqlsrvUtil;
/**
* @Iterations(1)
* @BeforeMethods({"connect", "setTableName" })
* @AfterMethods({ "disconnect"})
*/
class PDOFetchLargeBench{
class PDOFetchLargeBench
{
private $conn;
private $tableName;
public function setTableName(){
public function setTableName()
{
//Assumes the table is already populated with data
$this->tableName = "LargeDB.dbo.datatypes";
}
public function connect(){
public function connect()
{
$this->conn = PDOSqlsrvUtil::connect();
}
/*
* Each iteration calls prepare, execute and fetch APIs to fetch the already populdated data
*/
public function benchFetchWithPrepare(){
public function benchFetchWithPrepare()
{
PDOSqlsrvUtil::fetchWithPrepare( $this->conn, $this->tableName );
}
public function disconnect(){
public function disconnect()
{
PDOSqlsrvUtil::disconnect( $this->conn );
}
}

View file

@ -1,45 +1,55 @@
<?php
use PDOSqlsrvPerfTest\PDOSqlsrvUtil;
include_once __DIR__ . "/../../lib/CRUDBaseBenchmark.php";
/**
* @BeforeMethods({"connect", "setTableName", "createTable", "generateInsertValues"})
* @AfterMethods({ "dropTable", "disconnect"})
*/
class PDOInsertBench{
class PDOInsertBench extends CRUDBaseBenchmark
{
private $conn;
private $tableName;
private $insertValues;
public function setTableName(){
public function setTableName()
{
$this->tableName = "datatypes_".rand();
}
public function connect(){
public function connect()
{
$this->conn = PDOSqlsrvUtil::connect();
}
public function createTable(){
public function createTable()
{
PDOSqlsrvUtil::createCRUDTable( $this->conn, $this->tableName );
}
public function generateInsertValues(){
public function generateInsertValues()
{
$this->insertValues = PDOSqlsrvUtil::generateInsertValues();
}
/**
* Each iteration inserts 1000 rows into the table.
* Note that, every insertion calls prepare, bindParam and execute APIs.
*/
public function benchInsertWithPrepare(){
for ( $i=0; $i<1000; $i++){
public function benchInsertWithPrepare()
{
for ( $i=0; $i<PDOSqlsrvUtil::$loopsPerCRUDIter; $i++)
{
PDOSqlsrvUtil::insertWithPrepare( $this->conn, $this->tableName, $this->insertValues );
}
}
public function dropTable(){
public function dropTable()
{
PDOSqlsrvUtil::dropTable( $this->conn, $this->tableName );
}
public function disconnect(){
public function disconnect()
{
PDOSqlsrvUtil::disconnect( $this->conn );
}
}

View file

@ -2,24 +2,29 @@
use PDOSqlsrvPerfTest\PDOSqlsrvUtil;
/**
* @Iterations(10000)
* @BeforeMethods({"connect"})
* @AfterMethods({"disconnect"})
*/
class PDOSelectVersionBench{
class PDOSelectVersionBench
{
private $conn;
public function connect(){
public function connect()
{
$this->conn = PDOSqlsrvUtil::connect();
}
/*
* Each iteration calls execDirect API to fetch @@Version
*/
public function benchSelectVersion(){
public function benchSelectVersion()
{
$version = PDOSqlsrvUtil::selectVersion( $this->conn );
}
public function disconnect(){
public function disconnect()
{
PDOSqlsrvUtil::disconnect( $this->conn );
}
}

View file

@ -1,11 +1,13 @@
<?php
use PDOSqlsrvPerfTest\PDOSqlsrvUtil;
include_once __DIR__ . "/../../lib/CRUDBaseBenchmark.php";
/**
* @BeforeMethods({"connect", "setTableName", "createTable", "generateInsertValues", "insertWithPrepare", "generateUpdateValues", "generateUpdateParams"})
* @AfterMethods({"dropTable", "disconnect"})
*/
class PDOUpdateBench{
class PDOUpdateBench extends CRUDBaseBenchmark
{
private $conn;
private $tableName;
@ -13,48 +15,59 @@ class PDOUpdateBench{
private $updateValues;
private $updateParams;
public function setTableName(){
public function setTableName()
{
$this->tableName = "datatypes_".rand();
}
public function connect(){
public function connect()
{
$this->conn = PDOSqlsrvUtil::connect();
}
public function createTable(){
public function createTable()
{
PDOSqlsrvUtil::createCRUDTable( $this->conn, $this->tableName );
}
public function generateInsertValues(){
public function generateInsertValues()
{
$this->insertValues = PDOSqlsrvUtil::generateInsertValues();
}
public function insertWithPrepare(){
public function insertWithPrepare()
{
PDOSqlsrvUtil::insertWithPrepare( $this->conn, $this->tableName, $this->insertValues );
}
public function generateUpdateValues(){
public function generateUpdateValues()
{
$this->updateValues = PDOSqlsrvUtil::generateUpdateValues();
}
public function generateUpdateParams(){
public function generateUpdateParams()
{
$this->updateParams = PDOSqlsrvUtil::generateUpdateParams();
}
/**
* Each iteration inserts a row into the table, updateWithPrepare() updates that row 1000 times.
* Note that, every update calls prepare, bindParam and execute APIs.
*/
public function benchUpdateWithPrepare(){
for( $i=0; $i<1000; $i++ ){
public function benchUpdateWithPrepare()
{
for( $i=0; $i<PDOSqlsrvUtil::$loopsPerCRUDIter; $i++ )
{
$stmt = PDOSqlsrvUtil::updateWithPrepare( $this->conn, $this->tableName, $this->updateValues, $this->updateParams );
}
}
public function dropTable(){
public function dropTable()
{
PDOSqlsrvUtil::dropTable( $this->conn, $this->tableName );
}
public function disconnect(){
public function disconnect()
{
PDOSqlsrvUtil::disconnect( $this->conn );
}

View file

@ -1,12 +1,15 @@
<?php
use SqlsrvPerfTest\SqlsrvUtil;
include_once __DIR__ . "/../../lib/CRUDBaseBenchmark.php";
class SqlsrvConnectionBench{
class SqlsrvConnectionBench extends CRUDBaseBenchmark
{
/*
* Opens a connection and closes it immediately
*/
public function benchConnectAndDisconnect(){
public function benchConnectAndDisconnect()
{
$conn = SqlsrvUtil::connect();
SqlsrvUtil::disconnect( $conn );
}

View file

@ -1,14 +1,17 @@
<?php
use SqlsrvPerfTest\SqlsrvUtil;
include_once __DIR__ . "/../../lib/CRUDBaseBenchmark.php";
/**
* @BeforeMethods({"connect"})
* @AfterMethods({"disconnect"})
*/
class SqlsrvCreateDbTableProcBench{
class SqlsrvCreateDbTableProcBench extends CRUDBaseBenchmark
{
private $conn;
public function connect(){
public function connect()
{
$this->conn = SqlsrvUtil::connect();
}
@ -16,7 +19,8 @@ class SqlsrvCreateDbTableProcBench{
* Each iteration creates a database, a table and a stored procedure in that database and drops the database at the end.
* Note that, ODBC SQLExecDirect function are used to execute all the queries.
*/
public function benchCreateDbTableProc(){
public function benchCreateDbTableProc()
{
$randomNum = rand();
$databaseName = "test_db_$randomNum";
$tableName = "test_table_$randomNum";
@ -25,7 +29,8 @@ class SqlsrvCreateDbTableProcBench{
SqlsrvUtil::dropDatabase( $this->conn, $databaseName );
}
public function disconnect(){
public function disconnect()
{
SqlsrvUtil::disconnect( $this->conn );
}
}

View file

@ -1,34 +1,42 @@
<?php
use SqlsrvPerfTest\SqlsrvUtil;
include_once __DIR__ . "/../../lib/CRUDBaseBenchmark.php";
/**
* @BeforeMethods({"connect", "setTableName", "createTable", "generateInsertValues", "insertWithPrepare"})
* @AfterMethods({ "dropTable", "disconnect"})
*/
class SqlsrvDeleteBench{
class SqlsrvDeleteBench extends CRUDBaseBenchmark
{
private $conn;
private $tableName;
private $insertValues;
public function setTableName(){
public function setTableName()
{
$this->tableName = "datatypes_".rand();
}
public function connect(){
public function connect()
{
$this->conn = SqlsrvUtil::connect();
}
public function createTable(){
public function createTable()
{
SqlsrvUtil::createCRUDTable( $this->conn, $this->tableName );
}
public function generateInsertValues(){
public function generateInsertValues()
{
$this->insertValues = SqlsrvUtil::generateInsertValues();
}
public function insertWithPrepare(){
for ( $i=0; $i<1000; $i++ ){
public function insertWithPrepare()
{
for ( $i=0; $i<SqlsrvUtil::$loopsPerCRUDIter; $i++ )
{
SqlsrvUtil::insertWithPrepare( $this->conn, $this->tableName, $this->insertValues );
}
}
@ -36,17 +44,21 @@ class SqlsrvDeleteBench{
* Each iteration inserts 1000 rows into the table, benchDelete deletes top row from the table 1000 times.
* Note that, every delete calls prepare and execute APIs.
*/
public function benchDelete(){
for( $i=0; $i<1000; $i++ ){
public function benchDelete()
{
for( $i=0; $i<SqlsrvUtil::$loopsPerCRUDIter; $i++ )
{
SqlsrvUtil::delete( $this->conn, $this->tableName );
}
}
public function dropTable(){
public function dropTable()
{
SqlsrvUtil::dropTable( $this->conn, $this->tableName );
}
public function disconnect(){
public function disconnect()
{
SqlsrvUtil::disconnect( $this->conn );
}

View file

@ -1,35 +1,40 @@
<?php
use SqlsrvPerfTest\SqlsrvUtil;
include_once __DIR__ . "/../../lib/CRUDBaseBenchmark.php";
/**
* @BeforeMethods({"connect", "setTableName", "createTable", "generateInsertValues", "insertWithPrepare"})
* @AfterMethods({ "dropTable", "disconnect"})
*/
class SqlsrvFetchBench{
class SqlsrvFetchBench extends CRUDBaseBenchmark
{
private $conn;
private $tableName;
private $insertValues;
public function setTableName(){
public function setTableName()
{
$this->tableName = "datatypes_".rand();
}
public function connect(){
public function connect()
{
$this->conn = SqlsrvUtil::connect();
}
public function createTable(){
public function createTable()
{
SqlsrvUtil::createCRUDTable( $this->conn, $this->tableName );
}
public function generateInsertValues(){
public function generateInsertValues()
{
$this->insertValues = SqlsrvUtil::generateInsertValues();
}
public function insertWithPrepare(){
public function insertWithPrepare()
{
SqlsrvUtil::insertWithPrepare( $this->conn, $this->tableName, $this->insertValues );
}
@ -37,17 +42,21 @@ class SqlsrvFetchBench{
* Each iteration inserts a row into the table, benchFetchWithPrepare() fetches that row 1000 times.
* Note that, every fetch calls prepare, execute and fetch APIs.
*/
public function benchFetchWithPrepare(){
for( $i=0; $i<1000; $i++){
public function benchFetchWithPrepare()
{
for( $i=0; $i<SqlsrvUtil::$loopsPerCRUDIter; $i++)
{
SqlsrvUtil::fetchWithPrepare( $this->conn, $this->tableName );
}
}
public function dropTable(){
public function dropTable()
{
SqlsrvUtil::dropTable( $this->conn, $this->tableName );
}
public function disconnect(){
public function disconnect()
{
SqlsrvUtil::disconnect( $this->conn );
}
}

View file

@ -2,30 +2,36 @@
use SqlsrvPerfTest\SqlsrvUtil;
/**
* @Iterations(1)
* @BeforeMethods({"connect", "setTableName" })
* @AfterMethods({ "disconnect"})
*/
class SqlsrvFetchLargeBench{
class SqlsrvFetchLargeBench
{
private $conn;
private $tableName;
public function setTableName(){
public function setTableName()
{
//Assumes the table is already populated with data
$this->tableName = "LargeDB.dbo.datatypes";
}
public function connect(){
public function connect()
{
$this->conn = SqlsrvUtil::connect();
}
/*
* Each iteration calls prepare, execute and fetch APIs to fetch the already populdated data
*/
public function benchFetchWithPrepare(){
public function benchFetchWithPrepare()
{
SqlsrvUtil::fetchWithPrepare( $this->conn, $this->tableName );
}
public function disconnect(){
public function disconnect()
{
SqlsrvUtil::disconnect( $this->conn );
}
}

View file

@ -1,46 +1,56 @@
<?php
use SqlsrvPerfTest\SqlsrvUtil;
include_once __DIR__ . "/../../lib/CRUDBaseBenchmark.php";
/**
* @BeforeMethods({"connect", "setTableName", "createTable", "generateInsertValues"})
* @AfterMethods({"dropTable","disconnect"})
*/
class SqlsrvInsertBench{
class SqlsrvInsertBench extends CRUDBaseBenchmark
{
private $conn;
private $tableName;
private $insertValues;
public function setTableName(){
public function setTableName()
{
$this->tableName = "datatypes_".rand();
}
public function connect(){
public function connect()
{
$this->conn = SqlsrvUtil::connect();
}
public function createTable(){
public function createTable()
{
SqlsrvUtil::createCRUDTable( $this->conn, $this->tableName );
}
public function generateInsertValues(){
public function generateInsertValues()
{
$this->insertValues = SqlsrvUtil::generateInsertValues();
}
/**
* Each iteration inserts 1000 rows into the table.
* Note that, every insertion calls prepare, bindParam and execute APIs.
*/
public function benchInsertWithPrepare(){
for( $i=0; $i<1000; $i++ ){
public function benchInsertWithPrepare()
{
for( $i=0; $i<SqlsrvUtil::$loopsPerCRUDIter; $i++ )
{
SqlsrvUtil::insertWithPrepare( $this->conn, $this->tableName, $this->insertValues );
}
}
public function dropTable(){
public function dropTable()
{
SqlsrvUtil::dropTable( $this->conn, $this->tableName );
}
public function disconnect(){
public function disconnect()
{
SqlsrvUtil::disconnect( $this->conn );
}
}

View file

@ -2,24 +2,29 @@
use SqlsrvPerfTest\SqlsrvUtil;
/**
* @Iterations(10000)
* @BeforeMethods({"connect"})
* @AfterMethods({"disconnect"})
*/
class SqlsrvSelectVersionBench{
class SqlsrvSelectVersionBench
{
private $conn;
public function connect(){
public function connect()
{
$this->conn = SqlsrvUtil::connect();
}
/*
* Each iteration calls execDirect API to fetch @@Version
*/
public function benchSelectVersion(){
public function benchSelectVersion()
{
$version = SqlsrvUtil::selectVersion( $this->conn );
}
public function disconnect(){
public function disconnect()
{
SqlsrvUtil::disconnect( $this->conn );
}
}

View file

@ -1,11 +1,13 @@
<?php
use SqlsrvPerfTest\SqlsrvUtil;
include_once __DIR__ . "/../../lib/CRUDBaseBenchmark.php";
/**
* @BeforeMethods({"connect", "setTableName", "createTable", "generateInsertValues", "insertWithPrepare", "generateUpdateValues", "generateUpdateParams"})
* @AfterMethods({ "dropTable", "disconnect"})
*/
class SqlsrvUpdateBench{
class SqlsrvUpdateBench extends CRUDBaseBenchmark
{
private $conn;
private $tableName;
@ -13,48 +15,59 @@ class SqlsrvUpdateBench{
private $updateValues;
private $updateParams;
public function setTableName(){
public function setTableName()
{
$this->tableName = "datatypes_".rand();
}
public function connect(){
public function connect()
{
$this->conn = SqlsrvUtil::connect();
}
public function createTable(){
public function createTable()
{
SqlsrvUtil::createCRUDTable( $this->conn, $this->tableName );
}
public function generateInsertValues(){
public function generateInsertValues()
{
$this->insertValues = SqlsrvUtil::generateInsertValues();
}
public function insertWithPrepare(){
public function insertWithPrepare()
{
SqlsrvUtil::insertWithPrepare( $this->conn, $this->tableName, $this->insertValues );
}
public function generateUpdateValues(){
public function generateUpdateValues()
{
$this->updateValues = SqlsrvUtil::generateUpdateValues();
}
public function generateUpdateParams(){
public function generateUpdateParams()
{
$this->updateParams = SqlsrvUtil::generateUpdateParams();
}
/**
* Each iteration inserts a row into the table, updateWithPrepare() updates that row 1000 times.
* Note that, every update calls prepare, bindParam and execute APIs.
*/
public function benchUpdateWithPrepare(){
for( $i=0; $i<1000; $i++ ){
public function benchUpdateWithPrepare()
{
for( $i=0; $i<SqlsrvUtil::$loopsPerCRUDIter; $i++ )
{
$stmt = SqlsrvUtil::updateWithPrepare( $this->conn, $this->tableName, $this->updateValues, $this->updateParams );
}
}
public function dropTable(){
public function dropTable()
{
SqlsrvUtil::dropTable( $this->conn, $this->tableName );
}
public function disconnect(){
public function disconnect()
{
SqlsrvUtil::disconnect( $this->conn );
}

View file

@ -0,0 +1,9 @@
<?php
/**
* @Iterations(1000)
*/
abstract class CRUDBaseBenchmark
{
}
?>

View file

@ -2,32 +2,41 @@
namespace PDOSqlsrvPerfTest;
use PDO;
class PDOSqlsrvUtil{
class PDOSqlsrvUtil
{
public static function connect(){
public static $loopsPerCRUDIter = 100;
public static function connect()
{
require dirname(__FILE__).DIRECTORY_SEPARATOR.'connect.php';
try{
try
{
$conn = new PDO( "sqlsrv:Server=$server; Database=$database; ConnectionPooling=$pooling; MultipleActiveResultSets=$mars" , $uid, $pwd );
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
return $conn;
}
catch( PDOException $e ){
catch( PDOException $e )
{
var_dump( $e );
exit;
}
}
public static function disconnect( $conn ){
public static function disconnect( $conn )
{
$conn = null;
}
public static function selectVersion( $conn ){
public static function selectVersion( $conn )
{
$sql = "SELECT @@Version";
$stmt = self::query( $conn, $sql );
return self::fetch( $stmt );
}
public static function createDbTableProc( $conn, $databaseName, $tableName, $procName ){
public static function createDbTableProc( $conn, $databaseName, $tableName, $procName )
{
$tableParams = "id INTEGER, name VARCHAR(32), value INTEGER, start_date DATE, time_added TIMESTAMP, set_time TIME(7)";
$procParams = "@id INTEGER, @name VARCHAR(32)";
$procTextBase = "SET NOCOUNT ON; SELECT id, name, value FROM $databaseName.$tableName WHERE id = @id AND name = @name";
@ -37,7 +46,8 @@ class PDOSqlsrvUtil{
self::createStoredProc( $conn, $procName, $procParams, $procTextBase );
}
public static function generateInsertValues(){
public static function generateInsertValues()
{
$vcharVal = "test string";
$nvcharVal = "wstring";
$intVal = 3;
@ -52,7 +62,8 @@ class PDOSqlsrvUtil{
return $values;
}
public static function generateUpdateValues(){
public static function generateUpdateValues()
{
$vcharVal = "test string updated";
$nvcharVal = "wstring updated";
$intVal = 5;
@ -67,7 +78,8 @@ class PDOSqlsrvUtil{
return $updatedValues;
}
public static function generateUpdateParams(){
public static function generateUpdateParams()
{
$fieldNames = array(
"vstring",
"nvstring",
@ -81,41 +93,47 @@ class PDOSqlsrvUtil{
"dtoffset");
$params = "";
foreach( $fieldNames as $fieldName ){
foreach( $fieldNames as $fieldName )
{
$params = $params.$fieldName."=?,";
}
$params = rtrim($params,", ");
return $params;
}
public static function insertWithPrepare( $conn, $tableName, $values ){
public static function insertWithPrepare( $conn, $tableName, $values )
{
$sql = "INSERT INTO $tableName VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
$stmt = self::prepare( $conn, $sql );
self::bindParams( $stmt, $values );
self::execute( $stmt );
}
public static function fetchWithPrepare( $conn, $tableName ){
public static function fetchWithPrepare( $conn, $tableName )
{
$sql = "SELECT * FROM $tableName";
$stmt = self::prepare( $conn, $sql );
self::execute( $stmt );
while ( $row = self::fetch( $stmt )){}
}
public static function deleteWithPrepare( $conn, $tableName ){
public static function deleteWithPrepare( $conn, $tableName )
{
$sql = "DELETE TOP (1) FROM $tableName";
$stmt = self::prepare( $conn, $sql );
self::execute( $stmt );
}
public static function updateWithPrepare( $conn, $tableName, $updateValues, $params ){
public static function updateWithPrepare( $conn, $tableName, $updateValues, $params )
{
$sql = "UPDATE $tableName SET ".$params;
$stmt = self::prepare( $conn, $sql );
self::bindParams( $stmt, $updateValues );
self::execute( $stmt );
}
private function bindParams( $stmt, $values ){
private function bindParams( $stmt, $values )
{
//This functionn assumes the fields are from createCRUDTable()
self::bindParam( $stmt, 1, $values[0], PDO::PARAM_STR);
self::bindParam( $stmt, 2, $values[1], PDO::PARAM_STR);
@ -129,7 +147,8 @@ class PDOSqlsrvUtil{
self::bindParam( $stmt, 10, $values[9], PDO::PARAM_STR);
}
public static function createCRUDTable( $conn, $tableName ){
public static function createCRUDTable( $conn, $tableName )
{
$fields = array(
"vstring" => "VARCHAR(64)",
"nvstring" => "NVARCHAR(64)",
@ -142,86 +161,106 @@ class PDOSqlsrvUtil{
"vbin" => "VARBINARY",
"dtoffset" => "DATETIMEOFFSET");
$params = "";
foreach( $fields as $fieldName => $type ){
foreach( $fields as $fieldName => $type )
{
$params .= $fieldName." ".$type.",";
}
$params = rtrim($params,", ");
self::createTable( $conn, $tableName, $params );
}
private function createDatabase( $conn, $dbName ){
private function createDatabase( $conn, $dbName )
{
$sql = "CREATE DATABASE $dbName";
$conn->exec( $sql );
}
public static function dropDatabase( $conn, $dbName ){
public static function dropDatabase( $conn, $dbName )
{
$sql = "USE MASTER;DROP DATABASE $dbName";
$conn->exec( $sql );
}
public static function createTable( $conn, $tableName, $params ){
public static function createTable( $conn, $tableName, $params )
{
$sql = "CREATE TABLE $tableName ($params)";
$conn->exec( $sql );
}
public static function dropTable( $conn, $tableName ){
public static function dropTable( $conn, $tableName )
{
$sql = "DROP TABLE $tableName";
$conn->exec( $sql );
}
private function useDatabase( $conn, $dbName ){
private function useDatabase( $conn, $dbName )
{
$sql = "USE $dbName";
$conn->exec( $sql );
}
private function createStoredProc( $conn, $procName, $params, $text ){
private function createStoredProc( $conn, $procName, $params, $text )
{
$sql = "CREATE PROCEDURE $procName $params AS $text";
$conn->exec( $sql );
}
private function dropStoredProc( $conn, $procName ){
private function dropStoredProc( $conn, $procName )
{
$sql = "DROP PROCEDURE $procName";
$conn->exec( $sql );
}
private function query( $conn, $sql ){
try{
private function query( $conn, $sql )
{
try
{
return $conn->query( $sql );
}
catch( PDOException $e ){
catch( PDOException $e )
{
var_dump( $e );
exit;
}
}
private function fetch( $stmt ){
private function fetch( $stmt )
{
return $stmt->fetch();
}
private function prepare( $conn, $sql ){
try{
private function prepare( $conn, $sql )
{
try
{
$stmt = $conn->prepare( $sql );
if( $stmt === false ){
if( $stmt === false )
{
die( "Failed to prepare\n");
}
return $stmt;
}
catch( PDOException $e ){
catch( PDOException $e )
{
var_dump( $e );
exit;
}
}
private function execute( $stmt ){
private function execute( $stmt )
{
$ret = $stmt->execute();
if( $ret === false ){
if( $ret === false )
{
die( "Failed to execute\n" );
}
}
private function bindParam( $stmt, $index, $value, $type ){
private function bindParam( $stmt, $index, $value, $type )
{
$ret = $stmt->bindParam( $index, $value, $type );
if ( $ret === false){
if ( $ret === false)
{
die( "Faild to bind\n");
}
}

View file

@ -2,35 +2,45 @@
namespace SqlsrvPerfTest;
class SqlsrvUtil{
class SqlsrvUtil
{
public static $loopsPerCRUDIter = 100;
public static function connect(){
public static function connect()
{
require dirname(__FILE__).DIRECTORY_SEPARATOR.'connect.php';
$options = array( "Database"=>$database, "UID"=>$uid, "PWD"=>$pwd, "ConnectionPooling"=>$pooling, "MultipleActiveResultSets"=>$mars );
$conn = sqlsrv_connect( $server, $options );
if ( $conn === false ){
if ( $conn === false )
{
die( print_r( sqlsrv_errors(), true));
}
return $conn;
}
public static function disconnect( $conn ){
if ( $conn === false || $conn === null ){
public static function disconnect( $conn )
{
if ( $conn === false || $conn === null )
{
die( print_r( "Invalid connection resource\n"));
}
$ret = sqlsrv_close( $conn );
if ( $ret === false ){
if ( $ret === false )
{
die( print_r( sqlsrv_errors(), true));
}
}
public static function selectVersion( $conn ){
public static function selectVersion( $conn )
{
$sql = "SELECT @@Version";
$stmt = self::query( $conn, $sql );
return self::fetchArray( $stmt );
}
public static function createDbTableProc( $conn, $databaseName, $tableName, $procName ){
public static function createDbTableProc( $conn, $databaseName, $tableName, $procName )
{
$tableParams = "id INTEGER, name VARCHAR(32), value INTEGER, start_date DATE, time_added TIMESTAMP, set_time TIME(7)";
$procParams = "@id INTEGER, @name VARCHAR(32)";
$procTextBase = "SET NOCOUNT ON; SELECT id, name, value FROM $databaseName.$tableName WHERE id = @id AND name = @name";
@ -40,7 +50,8 @@ class SqlsrvUtil{
self::createStoredProc( $conn, $procName, $procParams, $procTextBase );
}
public static function generateInsertValues(){
public static function generateInsertValues()
{
$vcharVal = "test string";
$nvcharVal = "wstring";
$intVal = 3;
@ -55,7 +66,8 @@ class SqlsrvUtil{
return $values;
}
public static function generateUpdateValues(){
public static function generateUpdateValues()
{
$vcharVal = "test string updated";
$nvcharVal = "wstring updated";
$intVal = 5;
@ -70,7 +82,8 @@ class SqlsrvUtil{
return $updatedValues;
}
public static function generateUpdateParams(){
public static function generateUpdateParams()
{
$fieldNames = array(
"vstring",
"nvstring",
@ -84,33 +97,38 @@ class SqlsrvUtil{
"dtoffset");
$params = "";
foreach( $fieldNames as $fieldName ){
foreach( $fieldNames as $fieldName )
{
$params = $params.$fieldName."=?,";
}
$params = rtrim($params,", ");
return $params;
}
public static function insertWithPrepare( $conn, $tableName, $values ){
public static function insertWithPrepare( $conn, $tableName, $values )
{
$sql = "INSERT INTO $tableName VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
$stmt = self::prepare( $conn, $sql, $values );
self::execute( $stmt );
}
public static function updateWithPrepare( $conn, $tableName, $updateValues, $params ){
public static function updateWithPrepare( $conn, $tableName, $updateValues, $params )
{
$sql = "UPDATE $tableName SET ".$params;
$stmt = self::prepare( $conn, $sql, $updateValues );
self::execute( $stmt );
}
public static function fetchWithPrepare( $conn, $tableName ){
public static function fetchWithPrepare( $conn, $tableName )
{
$sql = "SELECT * FROM $tableName";
$stmt = self::prepare( $conn, $sql, array());
self::execute( $stmt );
while( $row = self::fetchArray( $stmt ) ) {}
}
public static function createCRUDTable( $conn, $tableName ){
public static function createCRUDTable( $conn, $tableName )
{
$fields = array(
"vstring" => "VARCHAR(64)",
"nvstring" => "NVARCHAR(64)",
@ -123,108 +141,131 @@ class SqlsrvUtil{
"vbin" => "VARBINARY",
"dtoffset" => "DATETIMEOFFSET");
$params = "";
foreach( $fields as $fieldName => $type ){
foreach( $fields as $fieldName => $type )
{
$params .= $fieldName." ".$type.",";
}
$params = rtrim($params,", ");
self::createTable( $conn, $tableName, $params );
}
public static function query( $conn, $sql ){
public static function query( $conn, $sql )
{
$stmt = sqlsrv_query( $conn, $sql );
if( $stmt === false ){
if( $stmt === false )
{
die( print_r( sqlsrv_errors(), true));
}
return $stmt;
}
public static function fetch( $stmt ){
public static function fetch( $stmt )
{
$ret = sqlsrv_fetch( $stmt );
if( $ret === false ){
if( $ret === false )
{
die( print_r( sqlsrv_errors(), true));
}
return $ret;
}
public static function fetchArray( $stmt ){
public static function fetchArray( $stmt )
{
$row = sqlsrv_fetch_array( $stmt );
if ( $row === false ){
if ( $row === false )
{
die( print_r( sqlsrv_errors(), true));
}
return $row;
}
public static function getField( $stmt, $index ){
public static function getField( $stmt, $index )
{
return sqlsrv_get_field( $stmt, $index );
}
private function createDatabase( $conn, $dbName ){
private function createDatabase( $conn, $dbName )
{
$sql = "CREATE DATABASE $dbName";
self::query( $conn, $sql );
}
public static function dropDatabase( $conn, $dbName ){
public static function dropDatabase( $conn, $dbName )
{
$sql = "USE MASTER;DROP DATABASE $dbName";
self::query( $conn, $sql );
}
public static function createTable( $conn, $tableName, $params ){
public static function createTable( $conn, $tableName, $params )
{
$sql = "CREATE TABLE $tableName ($params)";
self::query( $conn, $sql );
}
public static function dropTable( $conn, $tableName ){
public static function dropTable( $conn, $tableName )
{
$sql = "DROP TABLE $tableName";
self::query( $conn, $sql );
}
private function useDatabase( $conn, $dbName ){
private function useDatabase( $conn, $dbName )
{
$sql = "USE $dbName";
self::query( $conn, $sql );
}
private function createStoredProc( $conn, $procName, $params, $text ){
private function createStoredProc( $conn, $procName, $params, $text )
{
$sql = "CREATE PROCEDURE $procName $params AS $text";
self::query( $conn, $sql );
}
private function dropStoredProc( $conn, $procName ){
private function dropStoredProc( $conn, $procName )
{
$sql = "DROP PROCEDURE $procName";
self::query( $conn, $sql );
}
private function insert( $conn, $tableName, $values ){
private function insert( $conn, $tableName, $values )
{
$sql = "INSERT INTO $tableName values ($values)";
self::query( $conn, $sql );
}
private function update( $conn, $tableName, $params, $condition ){
private function update( $conn, $tableName, $params, $condition )
{
$sql = "UPDATE $tableName SET $params WHERE $condition";
self::query( $sql );
}
public function delete( $conn, $tableName){
public function delete( $conn, $tableName)
{
$sql = "DELETE TOP (1) FROM $tableName";
self::query( $conn, $sql );
}
public function deleteWithPrepare( $conn, $tableName ){
public function deleteWithPrepare( $conn, $tableName )
{
$sql = "DELETE TOP (1) FROM $tableName";
$stmt = self::prepare( $conn, $sql, array() );
self::execute( $stmt );
}
private function prepare( $conn, $sql, $params ){
private function prepare( $conn, $sql, $params )
{
$stmt = sqlsrv_prepare( $conn, $sql, $params );
if( $stmt === false ){
if( $stmt === false )
{
die( print_r( sqlsrv_errors(), true));
}
return $stmt;
}
public function execute( $stmt ){
public function execute( $stmt )
{
$ret = sqlsrv_execute( $stmt );
if ( $ret === false ){
if ( $ret === false )
{
die( print_r( sqlsrv_errors(), true));
}
}

View file

@ -0,0 +1,6 @@
<?php
$server = 'server';
$database = 'testdb';
$uid = 'usr';
$pwd = 'pwd';
?>

View file

@ -1,8 +1,9 @@
--The script can be run to read the results. You can filter out the results ran on a certain date by changing the date at the end.
DECLARE @convByteToMegabyte int = 1048576
select t1.ResultId, Test, Client, Server, Driver, Duration, Memory, Success, Team, StartTime from
(
select pr.ResultId, pr.Success, pt.TestName as Test, cl.HostName as Client, srv.HostName as Server,
tm.TeamName as Team, st.value as Driver, bi.value as Duration, bi2.value as Memory, dt.value as StartTime from
tm.TeamName as Team, st.value as Driver, bi.value as Duration, CAST(bi2.value AS decimal(10,2))/@convByteToMegabyte as Memory, dt.value as StartTime from
KeyValueTableBigInt bi,
KeyValueTableBigInt bi2,
KeyValueTableString st,
@ -20,5 +21,4 @@ and cl.ClientId = pr.ClientId
and pt.TestId = pr.TestId
and tm.TeamId = pr.TeamId
and srv.ServerId = pr.ServerId
) t1 where StartTime like '%2017-06-23%'
) t1 where StartTime like '%2017-06-23%'

View file

@ -25,19 +25,18 @@ from time import strftime
import hashlib
"""
Paths to current benchmarks. These constants should be modified if there are any changes in folder structure of the project. "regular" folder contains the benchmarks that can be run for any iterations. "large" folder contains the benchmarks ( currently the benchmark that fetches large amount of data ) that take long time to run and meant to have less number of iterations than the regular ones.
Paths to current benchmarks. These constants should be modified if there are any changes in folder structure of the project.
"""
sqlsrv_regular_path = "benchmark" + os.sep + "sqlsrv" + os.sep + "regular"
sqlsrv_large_path = "benchmark" + os.sep + "sqlsrv" + os.sep + "large"
pdo_regular_path = "benchmark" + os.sep + "pdo_sqlsrv" + os.sep + "regular"
pdo_large_path = "benchmark" + os.sep + "pdo_sqlsrv" + os.sep + "large"
sqlsrv_path = "benchmark" + os.sep + "sqlsrv"
pdo_path = "benchmark" + os.sep + "pdo_sqlsrv"
"""
Path to the connect.php file that contains test database credentials. Note that, the benchmarks are run against this database and it is different from Result database.
"""
connect_file = "lib" + os.sep + "connect.php"
connect_file_bak = connect_file + ".bak"
result_file = "lib" + os.sep + "result_db.php"
"""
Global data format used across the script
@ -139,18 +138,17 @@ def get_test_name( name ):
}
return test_name_dict[ name ]
def get_run_command( path_to_tests, iterations, dump_file ):
def get_run_command( path_to_tests, dump_file ):
"""
This module returns the command to run the tests
Args:
path_to_tests (str): The folder that contains the tests to be run
iterations (str): Number of iterations
dump_file (str): The name of the XML file to output the results
Returns:
The command to run the tests
"""
command = "vendor" + os.sep + "bin" + os.sep + "phpbench run {0} --iterations {1} --dump-file={2}"
return command.format( path_to_tests, iterations, dump_file )
command = "vendor" + os.sep + "bin" + os.sep + "phpbench run {0} --dump-file={1}"
return command.format( path_to_tests, dump_file )
def get_id( conn, id_field, table, name_field, value ):
"""
@ -196,14 +194,14 @@ def get_id_no_quote( conn, id_field, table, name_field, value ):
return id[0]
return id
def get_test_database():
def get_test_database( database_file ):
"""
This module reads test database details from connect.php and stores them into an instance of DB class
Returns:
A DB object that contains database credentials
"""
test_db = DB()
for line in open( connect_file ):
for line in open( database_file ):
if "server" in line:
test_db.server_name = line.split("=")[1].strip()[1:-2]
elif "database" in line:
@ -611,21 +609,23 @@ def disable_pooling():
copyfile( odbcinst_bak, odbcinst )
os.remove( odbcinst_bak )
def run_tests( iterations, iterations_large ):
def run_tests( php_driver, test_name ):
"""
This module runs the tests using PHPBench
Args:
iterations (int): Number of iterations the tests in "regular" folder are run for
iterations_large (int): Number of iterations the tests in "large" folder are run for
php_driver (str): Name of the driver to be tested: sqlsrv, pdo_sqlsrv, or both
test_name (str): File name of the test or all
Returns:
N/A
"""
print("Running the tests...")
call( get_run_command( sqlsrv_regular_path, iterations, "sqlsrv-regular.xml" ), shell=True )
call( get_run_command( sqlsrv_large_path, iterations_large, "sqlsrv-large.xml" ), shell=True )
call( get_run_command( pdo_regular_path, iterations, "pdo_sqlsrv-regular.xml" ), shell=True )
call( get_run_command( pdo_large_path, iterations_large, "pdo_sqlsrv-large.xml" ), shell=True )
add_to_path = ''
if test_name != 'all':
add_to_path = os.sep + test_name
if php_driver == 'sqlsrv' or php_driver == 'both':
call( get_run_command( sqlsrv_path + add_to_path, "sqlsrv-results.xml" ), shell=True )
if php_driver == 'pdo_sqlsrv' or php_driver == 'both':
call( get_run_command( pdo_path + add_to_path, "pdo_sqlsrv-results.xml" ), shell=True )
def parse_results( dump_file ):
"""
@ -656,6 +656,7 @@ def parse_results( dump_file ):
# If the bechmark was run successfully, parse the results. This is where you would add code to parse more details about the benchmark.
else:
xml_result.success = 1
# convert microseconds to seconds
xml_result.duration = int( round( int( benchmark[0][0].find( 'stats' ).get( 'sum' )) / 1000000 ))
iterations = benchmark[0][0].findall( 'iteration' )
xml_result.iterations = len( iterations )
@ -685,6 +686,11 @@ def parse_and_store_results( dump_file, test_db, result_db, platform, driver, st
Returns:
N/A
"""
# Check if the xml file actually exist
if not os.path.exists(dump_file):
print(dump_file + " does not exist")
return
# Connect to the Result Database
conn = connect( result_db )
@ -742,20 +748,14 @@ def parse_and_store_results_all( test_db, result_db, platform, start_time, mars,
"""
print("Parsing and storing the results...")
parse_and_store_results( "sqlsrv-regular.xml", test_db, result_db, platform, "sqlsrv", start_time, mars, pooling )
parse_and_store_results( "sqlsrv-large.xml", test_db, result_db, platform, "sqlsrv", start_time, mars, pooling )
parse_and_store_results( "pdo_sqlsrv-regular.xml", test_db, result_db, platform, "pdo_sqlsrv", start_time, mars, pooling )
parse_and_store_results( "pdo_sqlsrv-large.xml", test_db, result_db, platform, "pdo_sqlsrv", start_time, mars, pooling )
parse_and_store_results( "sqlsrv-results.xml", test_db, result_db, platform, "sqlsrv", start_time, mars, pooling )
parse_and_store_results( "pdo_sqlsrv-results.xml", test_db, result_db, platform, "pdo_sqlsrv", start_time, mars, pooling )
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument( '-platform', '--PLATFORM', required=True, help='The name of the platform the tests run on' )
parser.add_argument( '-iterations', '--ITERATIONS', required=True, help='Number of iterations for regular tests', type=int )
parser.add_argument( '-iterations-large', '--ITERATIONS_LARGE', required=True, help='Number of iterations for regular tests', type=int )
parser.add_argument( '-result-server', '--RESULT_SERVER', required=True, help='IP address of the Result Server' )
parser.add_argument( '-result-db', '--RESULT_DB', required=True, help='Name of the Result Database' )
parser.add_argument( '-result-uid', '--RESULT_UID', required=True, help='Username to connect to the Result Database' )
parser.add_argument( '-result-pwd', '--RESULT_PWD', required=True, help='Password to connect to the Result Database' )
parser.add_argument( '-platform', '--PLATFORM', required=True, help='The name of the platform the tests run on' )
parser.add_argument( '-php-driver', '--PHP_DRIVER', default='both', help='Name of the PHP driver: sqlsrv, pdo_sqlsrv or both')
parser.add_argument( '-testname', '--TESTNAME', default='all', help='File name for only one test or all' )
args = parser.parse_args()
# Start time is recorded only in the beginning of this script execution. So it is not benchmark specific.
@ -764,12 +764,12 @@ if __name__ == '__main__':
print( "Start time: " + start_time )
validate_platform( args.PLATFORM )
result_db = DB( args.RESULT_SERVER, args.RESULT_DB, args.RESULT_UID, args.RESULT_PWD )
test_db = get_test_database()
result_db = get_test_database( result_file )
test_db = get_test_database( connect_file )
print("Running the tests with default settings...")
run_tests( args.ITERATIONS, args.ITERATIONS_LARGE )
run_tests( args.PHP_DRIVER, args.TESTNAME )
parse_and_store_results_all( test_db, result_db, args.PLATFORM, start_time, 0, 0 )
"""
The following lines are commented out, because it already takes a long time to run the tests with the default settings.
@ -777,17 +777,17 @@ if __name__ == '__main__':
print("Running the tests with MARS ON...")
enable_mars()
run_tests( args.ITERATIONS, args.ITERATIONS_LARGE )
run_tests( args.PHP_DRIVER, args.TESTNAME )
parse_and_store_results_all( test_db, result_db, args.PLATFORM, start_time, 1, 0 )
disable_mars()
print("Running the tests with Pooling ON...")
enable_pooling()
run_tests( args.ITERATIONS, args.ITERATIONS_LARGE )
run_tests( args.PHP_DRIVER, args.TESTNAME )
parse_and_store_results_all( test_db, result_db, args.PLATFORM, start_time, 0, 1 )
disable_pooling()
"""
exit()