Skip to content

Commit 153ae06

Browse files
committed
Updated to latest version of PHPBench
1 parent 46b1d2f commit 153ae06

File tree

4 files changed

+27
-24
lines changed

4 files changed

+27
-24
lines changed

benchmarks/BaseBench.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use PhpBench\BenchmarkInterface;
77
use PHPCR\ImportUUIDBehaviorInterface;
88

9-
abstract class BaseBench implements BenchmarkInterface
9+
abstract class BaseBench
1010
{
1111
const ROOT_NAME = 'bench';
1212
const ROOT_PATH = '/bench';
@@ -88,7 +88,7 @@ protected function getRootNode()
8888
return $this->rootNode;
8989
}
9090

91-
protected function loadDump($filename, $remove = false)
91+
public function loadDump($filename, $remove = false)
9292
{
9393
$dumpPath = __DIR__ . '/../dumps/' . $filename;
9494

benchmarks/InsertBench.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@
77
use PHPCR\Benchmark\BaseBench;
88

99
/**
10-
* @group insert
11-
* @iterations 4
12-
* @revs 4
10+
* @Groups({"insert"})
11+
* @Iterations(4, sleep=1000000)
12+
* @Revs(4)
13+
* @OutputTimeUnit("seconds")
1314
*/
1415
class InsertBench extends BaseBench
1516
{
1617
private $index = 1;
1718

1819
/**
19-
* @paramProvider provideNbNodes
20-
* @beforeMethod beforeResetWorkspace
20+
* @ParamProviders({"provideNbNodes"})
21+
* @BeforeMethods({"beforeResetWorkspace"})
2122
*/
2223
public function benchInsertNodes($params)
2324
{

benchmarks/QueryBench.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,22 @@
66
use PHPCR\Benchmark\BaseBench;
77

88
/**
9-
* @group query
9+
* @Groups({"query"})
10+
* @Iterations(5)
11+
* @Sleep(5000)
12+
* @BeforeClassMethods({"beforeClass"})
13+
* @OutputTimeUnit("seconds")
1014
*/
1115
class QueryBench extends BaseBench
1216
{
13-
public function setUp()
17+
public static function beforeClass()
1418
{
15-
$this->loadDump('large_website.xml');
19+
(new self)->loadDump('large_website.xml');
1620
}
1721

1822
/**
19-
* @paramProvider provideQueries
20-
* @iterations 5
21-
* @group query_single_prop
23+
* @Groups({"query_single_prop"}, extend=true)
24+
* @ParamProviders({"provideQueries"})
2225
*/
2326
public function benchQuery($params)
2427
{
@@ -27,9 +30,8 @@ public function benchQuery($params)
2730
}
2831

2932
/**
30-
* @paramProvider provideQueries
31-
* @iterations 5
32-
* @group query_single_prop
33+
* @Groups({"query_single_prop"}, extend=true)
34+
* @ParamProviders({"provideQueries"})
3335
*/
3436
public function benchQueryWithNodes($params)
3537
{
@@ -42,9 +44,8 @@ public function benchQueryWithNodes($params)
4244
}
4345

4446
/**
45-
* @paramProvider provideQueries
46-
* @iterations 5
47-
* @group query_single_prop
47+
* @Groups({"query_single_prop"}, extend=true)
48+
* @ParamProviders({"provideQueries"})
4849
*/
4950
public function benchQueryIterate($params)
5051
{
@@ -57,9 +58,8 @@ public function benchQueryIterate($params)
5758
}
5859

5960
/**
60-
* @paramProvider provideProperties
61-
* @iterations 5
62-
* @group query_variable_props
61+
* @ParamProviders({"provideProperties"})
62+
* @Groups({"query_variable_prop"}, extend=true)
6363
*/
6464
public function benchQueryIterateVariableProperties($params)
6565
{

benchmarks/TraversalBench.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
use PHPCR\NodeInterface;
66

77
/**
8-
* @group traversal_full
9-
* @iterations 6
8+
* @Groups({"traversal_full"})
9+
* @Iterations(6)
10+
* @OutputTimeUnit("seconds")
1011
*/
1112
class TraversalBench extends BaseBench
1213
{
1314
public function setUp()
1415
{
16+
1517
$this->loadDump('large_website.xml');
1618
}
1719

0 commit comments

Comments
 (0)