Mercurial > prosody-modules
comparison mod_benchmark_storage/mod_benchmark_storage.lua @ 2195:967ba20e1202
mod_benchmark_storage: Switch to an invalid host and inject a stub host object
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 01 Jun 2016 14:34:30 +0200 |
| parents | 136497948bf0 |
| children | 2468bd4ec025 |
comparison
equal
deleted
inserted
replaced
| 2194:136497948bf0 | 2195:967ba20e1202 |
|---|---|
| 15 local test_driver = arg[1]; | 15 local test_driver = arg[1]; |
| 16 if not test_driver then | 16 if not test_driver then |
| 17 return print("Usage: prosodyctl mod_"..module.name.." <storage driver>"); | 17 return print("Usage: prosodyctl mod_"..module.name.." <storage driver>"); |
| 18 end | 18 end |
| 19 | 19 |
| 20 local hostname = "localhost"; | 20 local hostname = "benchmark.invalid"; |
| 21 prosody.hosts[hostname] = { | |
| 22 type = "local", | |
| 23 events = prosody.events, | |
| 24 modules = {}, | |
| 25 sessions = {}, | |
| 26 users = require "core.usermanager".new_null_provider(hostname) | |
| 27 }; | |
| 21 | 28 |
| 22 sm.initialize_host(hostname); | 29 sm.initialize_host(hostname); |
| 23 um.initialize_host(hostname); | 30 um.initialize_host(hostname); |
| 24 | 31 |
| 25 local start_time = gettime(); | 32 local start_time = gettime(); |
