Last active
August 29, 2015 14:16
-
-
Save pushpesh4u/d6c475313dc4dd9c33e0 to your computer and use it in GitHub Desktop.
Benchmark script
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
<?php | |
$time = microtime( true ); | |
for( $i = 0; $i < $numRequests; $i++ ) { | |
$obj = new Base\Aerospike( 'test', 'mytest', 1 ); | |
$ldt = $obj->createLDT( 'List', 'sbin' ); | |
if( $ldt->isLDT( 'List' ) ) { | |
$find = array( 'key' => $searchKey ); | |
$status = $ldt->find( $find ); | |
if( gettype( $status ) == 'array' ) { | |
$logger[] = '<li class="success">Successfully got the key in the LDT :: ' . $searchKey . '.</li>'; | |
} else { | |
header("HTTP/1.0 404 Not Found"); | |
header("Reason: Key not found in aerospike"); | |
$logger[] = '<li class="error">No bin with such key in the LDT.</li>'; | |
} | |
} else { | |
header("HTTP/1.0 404 Not Found"); | |
header("Reason: Aerospike reports that bin is not an LDT yet!"); | |
$logger[] = "<li class=\"error\">Aerospike connection failed! Request #" . $i . "</li>"; | |
} | |
} | |
$logger[] = "<li class=\"notice\">Time taken : " . ( microtime( true ) - $time ) . " seconds</li>"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment