|
@@ -19,7 +19,7 @@ $app->get('/json', function() {
|
|
|
|
|
|
// Test 2: Single database query
|
|
|
$app->get('/db', function() {
|
|
|
- $db = new mysqli('192.168.100.102', 'benchmarkdbuser', 'benchmarkdbpass', 'hello_world');
|
|
|
+ $db = new mysqli('172.16.98.120', 'benchmarkdbuser', 'benchmarkdbpass', 'hello_world');
|
|
|
$row = mysqli_query($db, 'SELECT id, randomNumber FROM World WHERE id = '.rand(1, 10000));
|
|
|
|
|
|
return new Response(json_encode(mysqli_fetch_assoc($row)), 200, array('Content-Type' => 'application/json'));
|
|
@@ -28,7 +28,7 @@ $app->get('/db', function() {
|
|
|
// Test 3: Multiple database queries
|
|
|
$app->get('/queries', function(Request $request) {
|
|
|
$queries = max(1, min($request->query->get('queries'), 500));
|
|
|
- $db = new mysqli('192.168.100.102', 'benchmarkdbuser', 'benchmarkdbpass', 'hello_world');
|
|
|
+ $db = new mysqli('172.16.98.120', 'benchmarkdbuser', 'benchmarkdbpass', 'hello_world');
|
|
|
|
|
|
for ($i=0; $i<$queries; $i++) {
|
|
|
$rows[] = mysqli_fetch_assoc(mysqli_query($db, 'SELECT id, randomNumber FROM World WHERE id = '.rand(1, 10000)));
|
|
@@ -39,7 +39,7 @@ $app->get('/queries', function(Request $request) {
|
|
|
|
|
|
// Test 4: Fortunes
|
|
|
$app->get('/fortunes', function() {
|
|
|
- $db = new mysqli('192.168.100.102', 'benchmarkdbuser', 'benchmarkdbpass', 'hello_world');
|
|
|
+ $db = new mysqli('172.16.98.120', 'benchmarkdbuser', 'benchmarkdbpass', 'hello_world');
|
|
|
$result = mysqli_query($db, 'SELECT * FROM Fortune');
|
|
|
while ($row = mysqli_fetch_row($result)) {
|
|
|
$fortunes[$row[0]] = htmlspecialchars($row[1], ENT_IGNORE);
|
|
@@ -58,7 +58,7 @@ $app->get('/fortunes', function() {
|
|
|
// Test 5: Database updates
|
|
|
$app->get('/updates', function(Request $request) {
|
|
|
$queries = max(1, min($request->query->get('queries'), 500));
|
|
|
- $db = new mysqli('192.168.100.102', 'benchmarkdbuser', 'benchmarkdbpass', 'hello_world');
|
|
|
+ $db = new mysqli('172.16.98.120', 'benchmarkdbuser', 'benchmarkdbpass', 'hello_world');
|
|
|
for ($i=0; $i<$queries; $i++) {
|
|
|
$rows[] = mysqli_fetch_assoc(mysqli_query($db, 'SELECT id, randomNumber FROM World WHERE id = '.rand(1, 10000)));
|
|
|
}
|