} $db->put('/test'); // /* $start = microtime(true); for ($i = 0; $i < $puts; ++$i) { $doc = new phpillowUserDocument(); $doc->login = '******' . $i; $doc->name = 'Kore Nordmann'; $doc->save(); } printf("%d PUTs in %.2fs (%d req/s)\n", $puts, $time = microtime(true) - $start, $puts / $time); // */ $start = microtime(true); for ($i = 0; $i < $gets; ++$i) { $doc = new phpillowUserDocument('user-kore_0'); } printf("%d GETs in %.2fs (%d req/s)\n", $gets, $time = microtime(true) - $start, $gets / $time); $start = microtime(true); $doc = phpillowUserView::user(array('key' => 'kore_0')); printf("First view in %.2fs (%d req/s)\n", $time = microtime(true) - $start, 1 / $time); $start = microtime(true); for ($i = 0; $i < $views; ++$i) { $doc = phpillowUserView::user(array('key' => 'kore_0')); } printf("%d views in %.2fs (%d req/s)\n", $views, $time = microtime(true) - $start, $views / $time); // Cleanup try { $db->delete('/test'); } catch (Exception $e) { /* Ignore */ }
public function testDirectStaticQueryWithOptions() { if (version_compare(PHP_VERSION, '5.3', '<')) { $this->markTestSkipped('PHP 5.3 is minimum requirement for this test.'); } $results = phpillowUserView::user(array('key' => 'kore')); $this->assertSame(1, count($results->rows)); $this->assertSame(array('id' => 'user-kore', 'key' => 'kore', 'value' => 'user-kore'), $results->rows[0]); }