Top Level Namespace

Defined Under Namespace

Modules: StraightServer Classes: Hash, String

Constant Summary collapse

BENCHMARK_DB_FILE =

Request example Simulate 100 users, 10000 requests example (GET) ab -n 10000 -c 100 localhost:9000/

File.expand_path('benchmark/straight.db')

Constants included from StraightServer::Initializer

StraightServer::Initializer::GEM_ROOT, StraightServer::Initializer::MIGRATIONS_ROOT

Instance Method Summary collapse

Methods included from StraightServer::Initializer

#add_route, #connect_to_db, #create_config_files, #create_logger, #initialize_routes, #load_addons, #migrations_pending?, #prepare, #read_config_file, #resume_tracking_active_orders!, #run_migrations, #setup_redis_connection

Instance Method Details

#delete_benchmark_dbObject



10
11
12
# File 'bin/straight-server-benchmark', line 10

def delete_benchmark_db
  FileUtils.rm_f(BENCHMARK_DB_FILE) if File.exists?(BENCHMARK_DB_FILE)
end

#delete_log_filesObject



14
15
16
17
18
# File 'bin/straight-server-benchmark', line 14

def delete_log_files
  logs_to_delete = Dir[File.expand_path('benchmark') + "/*.log*"] +
                   Dir[File.expand_path('bin') + "/*.log*"]
  logs_to_delete.each { |f| FileUtils.rm_f(f) } unless logs_to_delete.empty?
end