php-sqlsrv/test/Performance/benchmark/pdo_sqlsrv/PDOFetchLargeBench.php
2017-08-25 15:15:24 -07:00

38 lines
810 B
PHP

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