diff mod_benchmark_storage/mod_benchmark_storage.lua @ 2194:136497948bf0

mod_benchmark_storage: Put hostname in a variable
author Kim Alvefur <zash@zash.se>
date Wed, 01 Jun 2016 14:33:57 +0200
parents f2705465cab4
children 967ba20e1202
line wrap: on
line diff
--- a/mod_benchmark_storage/mod_benchmark_storage.lua	Tue May 31 17:24:59 2016 +0200
+++ b/mod_benchmark_storage/mod_benchmark_storage.lua	Wed Jun 01 14:33:57 2016 +0200
@@ -17,11 +17,13 @@
 		return print("Usage: prosodyctl mod_"..module.name.." <storage driver>");
 	end
 
-	sm.initialize_host("localhost");
-	um.initialize_host("localhost");
+	local hostname = "localhost";
+
+	sm.initialize_host(hostname);
+	um.initialize_host(hostname);
 
 	local start_time = gettime();
-	local storage = assert(sm.load_driver("localhost", test_driver));
+	local storage = assert(sm.load_driver(hostname, test_driver));
 	storage = assert(storage:open("benchmark"));
 	-- for i = 1, 23 do
 		-- storage:set(test_users[i], test_data);
@@ -43,7 +45,7 @@
 	for i = 1, 23 do
 		storage:set(test_users[i], nil);
 	end
-	mm.unload("localhost", "storage_"..test_driver);
+	mm.unload(hostname, "storage_"..test_driver);
 	local time_taken = gettime() - start_time;
 	io.write("\27[0G\27[K"); -- Clear current line
 	io.flush();