File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,13 @@ Windows 10 Version 21H1 (Build 19043.1645)
185185Number of HTTP server threads: 8
186186Logging of every request is disabled for both server and client side.
187187
188+ Starting applications without logging messages for every HTTP request:
189+
190+ ``` bash
191+ WebServer.exe --no-logs
192+ Client.exe --no-logs
193+ ```
194+
188195### Results
189196
190197| Number of <br />request threads | 10K requests <br />per thread, req/sec | 100K requests <br />per thread, req/sec |
Original file line number Diff line number Diff line change 44import http .client
55import multiprocessing
66import random
7+ import sys
78import time
89import urllib .parse
910
2728
2829PERCENT_OF_WRITES = 1
2930
30- LOG_EVERY_REQUEST = True
31+ arg1 = sys .argv [1 ] if len (sys .argv ) > 1 else ''
32+
33+ LOG_EVERY_REQUEST = arg1 != '--no-logs'
3134
3235# =======================================
3336
Original file line number Diff line number Diff line change 1111#include < thread>
1212
1313
14- int main (void )
14+ int main (const int argc, const char * const * const argv )
1515{
1616 LOG_INFO << " main: begin" << std::endl;
17+ const std::string arg1 = argc > 1 ? argv[1 ] : " " ;
1718
1819 // =========================================================
1920 // === Configuration:
2021 // =========================================================
2122
2223 const std::string listenHost = " 127.0.0.1" ;
2324 const std::uint16_t listenPort = 8000 ;
24- const std::string databaseFilename = " database.json" ;
25- const bool logEachRequest = true ;
25+ const std::string databaseFilename = " database.json" ;
26+ const bool logEachRequest = arg1 != " --no-logs " ;
2627
2728 // =========================================================
2829
You can’t perform that action at this time.
0 commit comments