forked from gajus/xhprof.io
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: composer.json
- Loading branch information
Showing
7 changed files
with
99 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
xhprof/includes/config.inc.php | ||
*.custom.php | ||
*.custom.php | ||
composer.lock | ||
/vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
language: php | ||
|
||
php: | ||
- 5.3 | ||
- 5.4 | ||
- 5.5 | ||
|
||
before_script: | ||
- composer self-update | ||
- composer update --prefer-source | ||
- mysql -e 'create database xhprof;' | ||
- mysql xhprof < ./setup/database.sql | ||
|
||
script: | ||
- php -n ./vendor/bin/athletic --path ./tests/performance/ --bootstrap ./tests/Bootstrap.php --formatter GroupedFormatter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit | ||
bootstrap="./tests/Bootstrap.php" | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
syntaxCheck="false" | ||
> | ||
<testsuites> | ||
<testsuite name="xhprof.io Test Suite"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
ini_set('error_reporting', E_ALL); | ||
|
||
$files = array(__DIR__ . '/../vendor/autoload.php', __DIR__ . '/../../../autoload.php'); | ||
|
||
foreach ($files as $file) { | ||
if (file_exists($file)) { | ||
$loader = require $file; | ||
|
||
break; | ||
} | ||
} | ||
|
||
if (! isset($loader)) { | ||
throw new RuntimeException('vendor/autoload.php could not be found. Did you run `php composer.phar install`?'); | ||
} | ||
|
||
/* @var $loader \Composer\Autoload\ClassLoader */ | ||
$loader->add('DataPersistancePerfEvent', __DIR__ .'/performance/'); | ||
|
||
unset($files, $file, $loader); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
class DataPersistancePerfEvent extends Athletic\AthleticEvent { | ||
/** | ||
* @var array | ||
*/ | ||
private $testProfile; | ||
|
||
/** | ||
* @var PDO | ||
*/ | ||
private $pdo; | ||
|
||
public function classSetUp() | ||
{ | ||
$this->testProfile = unserialize(file_get_contents(dirname(__FILE__) .'/test.profile')); | ||
$this->pdo = new PDO('mysql:dbname=xhprof;host=127.0.0.1', 'root', ''); | ||
} | ||
|
||
/** | ||
* @iterations 1000 | ||
*/ | ||
public function persistProfile() | ||
{ | ||
// XXX fake server env in a cleaner way | ||
$_SERVER['HTTP_HOST'] = 'localhost'; | ||
$_SERVER['REQUEST_URI'] = '/index.htm'; | ||
$_SERVER['REQUEST_METHOD'] = 'GET'; | ||
|
||
$xhprof_data_obj = new \ay\xhprof\Data($this->pdo); | ||
$xhprof_data_obj->save($this->testProfile); | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.