From 78a8c67305adfdd9166522765074bfcfee2c21da Mon Sep 17 00:00:00 2001 From: ulvii Date: Wed, 12 Jul 2017 13:35:15 -0700 Subject: [PATCH] Applying changes based on the review comments --- .../regular/PDOCreateDbTableProcBench.php | 2 +- test/Performance/report.sql | 2 +- test/Performance/run-perf_tests.py | 33 ++++++++++--------- test/Performance/setup_env_windows.ps1 | 2 +- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/test/Performance/benchmark/pdo_sqlsrv/regular/PDOCreateDbTableProcBench.php b/test/Performance/benchmark/pdo_sqlsrv/regular/PDOCreateDbTableProcBench.php index 53642b6a..ef27cf39 100644 --- a/test/Performance/benchmark/pdo_sqlsrv/regular/PDOCreateDbTableProcBench.php +++ b/test/Performance/benchmark/pdo_sqlsrv/regular/PDOCreateDbTableProcBench.php @@ -13,7 +13,7 @@ class PDOCreateDbTableProcBench{ } /* * Each iteration creates a database, a table and a stored procedure in that database and drops the database at the end. - * Not that, execDirect function are used to execute all the queries. + * Note that, execDirect function are used to execute all the queries. */ public function benchCreateDbTableProc(){ $randomNum = rand(); diff --git a/test/Performance/report.sql b/test/Performance/report.sql index 981aa1cc..859e769a 100644 --- a/test/Performance/report.sql +++ b/test/Performance/report.sql @@ -1,4 +1,4 @@ ---The script can be run to read the results +--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. 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, diff --git a/test/Performance/run-perf_tests.py b/test/Performance/run-perf_tests.py index 85ccc579..d68fd154 100644 --- a/test/Performance/run-perf_tests.py +++ b/test/Performance/run-perf_tests.py @@ -89,7 +89,7 @@ class XMLResult( object ): A class to keep a result set of a benchmark generated by PHPBench as an XML file. Attributes: benchmark_name (str): The name or the benchmark. - success (int): 0 or 1. 0 if the benchmark to execute, 1 if the execution was successful. + success (int): 0 or 1. 0 if the benchmark failed to execute, 1 if the execution was successful. duration (int,optional): In case of success, time taken to run the benchmark. memory (int, optional): In case of success, memory peak when executing the benchmark. iterations(int, optional): In case of success, number of iterations the benchmark was run for. @@ -442,7 +442,7 @@ def insert_result_entry_and_get_id( conn, test_id, client_id, driver_id, server_ return result_id[0] return id -def insert_key_value( conn, table_name, result_id, key, value ): +def insert_result_key_value( conn, table_name, result_id, key, value ): """ This module inserts a new entry into a key-value table. Args: @@ -636,7 +636,7 @@ def parse_results( dump_file ): Args: dump_file (str): The name of the XML file to be parsed. Returns: - N/A + An array of XMLResult objects, where each object contains benchmark information, such as duration and memory. """ xml_results = [] tree = ET.parse( dump_file ) @@ -710,21 +710,22 @@ def parse_and_store_results( dump_file, test_db, result_db, platform, driver, st result_id = insert_result_entry_and_get_id( conn, test_id, client_id, driver_id, server_id, team_id, result.success ) if result.success: - insert_key_value( conn, "KeyValueTableBigInt", result_id, "duration", result.duration ) - insert_key_value( conn, "KeyValueTableBigInt", result_id, "memory", result.memory ) - insert_key_value( conn, "KeyValueTableBigInt", result_id, "iterations", result.iterations) + insert_result_key_value( conn, "KeyValueTableBigInt", result_id, "duration", result.duration ) + insert_result_key_value( conn, "KeyValueTableBigInt", result_id, "memory", result.memory ) + insert_result_key_value( conn, "KeyValueTableBigInt", result_id, "iterations", result.iterations) else: - insert_key_value( conn, "KeyValueTableString", result_id, "error", result.error_message ) + insert_result_key_value( conn, "KeyValueTableString", result_id, "error", result.error_message ) - insert_key_value( conn, "KeyValueTableDate" , result_id, "startTime" , start_time ) - insert_key_value( conn, "KeyValueTableBigInt", result_id, "mars" , mars ) - insert_key_value( conn, "KeyValueTableBigInt", result_id, "pooling" , pooling ) - insert_key_value( conn, "KeyValueTableString", result_id, "driver" , driver ) - insert_key_value( conn, "KeyValueTableString", result_id, "php_arch" , php_arch ) - insert_key_value( conn, "KeyValueTableString", result_id, "os" , platform ) - insert_key_value( conn, "KeyValueTableString", result_id, "php_thread" , php_thread ) - insert_key_value( conn, "KeyValueTableString", result_id, "php_version", php_version ) - insert_key_value( conn, "KeyValueTableString", result_id, "msodbcsql" , msodbcsql_version ) + insert_result_key_value( conn, "KeyValueTableDate" , result_id, "startTime" , start_time ) + insert_result_key_value( conn, "KeyValueTableBigInt", result_id, "mars" , mars ) + insert_result_key_value( conn, "KeyValueTableBigInt", result_id, "pooling" , pooling ) + insert_result_key_value( conn, "KeyValueTableString", result_id, "driver" , driver ) + insert_result_key_value( conn, "KeyValueTableString", result_id, "php_arch" , php_arch ) + insert_result_key_value( conn, "KeyValueTableString", result_id, "os" , platform ) + insert_result_key_value( conn, "KeyValueTableString", result_id, "php_thread" , php_thread ) + insert_result_key_value( conn, "KeyValueTableString", result_id, "php_version" , php_version ) + insert_result_key_value( conn, "KeyValueTableString", result_id, "msodbcsql" , msodbcsql_version ) + insert_result_key_value( conn, "KeyValueTableString", result_id, "driver_version" , driver_version ) def parse_and_store_results_all( test_db, result_db, platform, start_time, mars, pooling ): """ diff --git a/test/Performance/setup_env_windows.ps1 b/test/Performance/setup_env_windows.ps1 index dc1aff65..2ac0d766 100644 --- a/test/Performance/setup_env_windows.ps1 +++ b/test/Performance/setup_env_windows.ps1 @@ -103,7 +103,7 @@ Copy-Item C:\php-sdk\phpdev\vc14\$ARCH\deps\bin\ssleay32.dll C:\Windows -force Copy-Item C:\php-sdk\phpdev\vc14\$ARCH\deps\bin\libeay32.dll C:\Windows -force cd $startingDir -$env:Path += ";C:\php\" +[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\php\", [System.EnvironmentVariableTarget]::Machine) RefreshEnv wget https://getcomposer.org/installer -O composer-setup.php php composer-setup.php