Applying changes based on the review comments

This commit is contained in:
ulvii 2017-07-12 13:35:15 -07:00
parent 4aee258fe4
commit 78a8c67305
4 changed files with 20 additions and 19 deletions

View file

@ -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. * 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(){ public function benchCreateDbTableProc(){
$randomNum = rand(); $randomNum = rand();

View file

@ -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 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, select pr.ResultId, pr.Success, pt.TestName as Test, cl.HostName as Client, srv.HostName as Server,

View file

@ -89,7 +89,7 @@ class XMLResult( object ):
A class to keep a result set of a benchmark generated by PHPBench as an XML file. A class to keep a result set of a benchmark generated by PHPBench as an XML file.
Attributes: Attributes:
benchmark_name (str): The name or the benchmark. 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. 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. 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. 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 result_id[0]
return id 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. This module inserts a new entry into a key-value table.
Args: Args:
@ -636,7 +636,7 @@ def parse_results( dump_file ):
Args: Args:
dump_file (str): The name of the XML file to be parsed. dump_file (str): The name of the XML file to be parsed.
Returns: Returns:
N/A An array of XMLResult objects, where each object contains benchmark information, such as duration and memory.
""" """
xml_results = [] xml_results = []
tree = ET.parse( dump_file ) 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 ) result_id = insert_result_entry_and_get_id( conn, test_id, client_id, driver_id, server_id, team_id, result.success )
if result.success: if result.success:
insert_key_value( conn, "KeyValueTableBigInt", result_id, "duration", result.duration ) insert_result_key_value( conn, "KeyValueTableBigInt", result_id, "duration", result.duration )
insert_key_value( conn, "KeyValueTableBigInt", result_id, "memory", result.memory ) insert_result_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, "iterations", result.iterations)
else: 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_result_key_value( conn, "KeyValueTableDate" , result_id, "startTime" , start_time )
insert_key_value( conn, "KeyValueTableBigInt", result_id, "mars" , mars ) insert_result_key_value( conn, "KeyValueTableBigInt", result_id, "mars" , mars )
insert_key_value( conn, "KeyValueTableBigInt", result_id, "pooling" , pooling ) insert_result_key_value( conn, "KeyValueTableBigInt", result_id, "pooling" , pooling )
insert_key_value( conn, "KeyValueTableString", result_id, "driver" , driver ) insert_result_key_value( conn, "KeyValueTableString", result_id, "driver" , driver )
insert_key_value( conn, "KeyValueTableString", result_id, "php_arch" , php_arch ) insert_result_key_value( conn, "KeyValueTableString", result_id, "php_arch" , php_arch )
insert_key_value( conn, "KeyValueTableString", result_id, "os" , platform ) insert_result_key_value( conn, "KeyValueTableString", result_id, "os" , platform )
insert_key_value( conn, "KeyValueTableString", result_id, "php_thread" , php_thread ) insert_result_key_value( conn, "KeyValueTableString", result_id, "php_thread" , php_thread )
insert_key_value( conn, "KeyValueTableString", result_id, "php_version", php_version ) insert_result_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, "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 ): def parse_and_store_results_all( test_db, result_db, platform, start_time, mars, pooling ):
""" """

View file

@ -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 Copy-Item C:\php-sdk\phpdev\vc14\$ARCH\deps\bin\libeay32.dll C:\Windows -force
cd $startingDir cd $startingDir
$env:Path += ";C:\php\" [Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\php\", [System.EnvironmentVariableTarget]::Machine)
RefreshEnv RefreshEnv
wget https://getcomposer.org/installer -O composer-setup.php wget https://getcomposer.org/installer -O composer-setup.php
php composer-setup.php php composer-setup.php