php-sqlsrv/test/Performance/benchmark/sqlsrv/SqlsrvFetchLargeBench.php

33 lines
778 B
PHP
Raw Normal View History

2017-05-06 02:32:09 +02:00
<?php
use SqlsrvPerfTest\SqlsrvUtil;
/**
* @Iterations(1)
2017-05-06 02:32:09 +02:00
* @BeforeMethods({"connect", "setTableName" })
* @AfterMethods({ "disconnect"})
*/
class SqlsrvFetchLargeBench{
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 = SqlsrvUtil::connect();
}
/*
* Each iteration calls prepare, execute and fetch APIs to fetch the already populdated data
*/
public function benchFetchWithPrepare(){
SqlsrvUtil::fetchWithPrepare( $this->conn, $this->tableName );
}
public function disconnect(){
SqlsrvUtil::disconnect( $this->conn );
}
}