diff options
Diffstat (limited to 'vendor/ruflin/elastica/test/benchmark/ClientTest.php')
-rw-r--r-- | vendor/ruflin/elastica/test/benchmark/ClientTest.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/vendor/ruflin/elastica/test/benchmark/ClientTest.php b/vendor/ruflin/elastica/test/benchmark/ClientTest.php new file mode 100644 index 00000000..e7a040f7 --- /dev/null +++ b/vendor/ruflin/elastica/test/benchmark/ClientTest.php @@ -0,0 +1,31 @@ +<?php + +use Elastica\Client; +use Elastica\Document; + +class ClientTest extends \PHPUnit_Framework_TestCase +{ + + public function testServersArray() + { + $client = new Client(); + $index = $client->getIndex('test'); + $index->create(array(), true); + $type = $index->getType('test'); + + $start = microtime(true); + + for ($i = 1; $i <= 10000; $i++) { + $doc = new Document($i, array('test' => 1)); + $type->addDocument($doc); + } + + // Refresh index + $index->refresh(); + + $end = microtime(true); + + //echo $end - $start; + + } +} |