Changeset ae020ea
- Timestamp:
- Jun 14, 2022, 11:46:48 AM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- aec20700
- Parents:
- 563a36b
- Location:
- benchmark/io/http
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/io/http/printer.cfa
r563a36b rae020ea 6 6 7 7 void ?{}( sendfile_stats_t & this ) { 8 this.maxfd = 0; 9 this.close = 0; 8 10 this.calls = 0; 9 11 this.tries = 0; … … 18 20 19 21 void push(sendfile_stats_t & from, sendfile_stats_t & to) { 20 __atomic_fetch_add(&to.calls, from.calls, __ATOMIC_RELAXED); from.calls = 0; 21 __atomic_fetch_add(&to.tries, from.tries, __ATOMIC_RELAXED); from.tries = 0; 22 __atomic_fetch_add(&to.header, from.header, __ATOMIC_RELAXED); from.header = 0; 23 __atomic_fetch_add(&to.splcin, from.splcin, __ATOMIC_RELAXED); from.splcin = 0; 24 __atomic_fetch_add(&to.splcot, from.splcot, __ATOMIC_RELAXED); from.splcot = 0; 22 to.maxfd = max( to.maxfd, from.maxfd); 23 to.close += from.close; from.close = 0; 24 to.calls += from.calls; from.calls = 0; 25 to.tries += from.tries; from.tries = 0; 26 to.header += from.header; from.header = 0; 27 to.splcin += from.splcin; from.splcin = 0; 28 to.splcot += from.splcot; from.splcot = 0; 25 29 for(i; zipf_cnts) { 26 __atomic_fetch_add(&to.avgrd[i].calls, from.avgrd[i].calls, __ATOMIC_RELAXED); from.avgrd[i].calls = 0;27 __atomic_fetch_add(&to.avgrd[i].bytes, from.avgrd[i].bytes, __ATOMIC_RELAXED); from.avgrd[i].bytes = 0;30 to.avgrd[i].calls += from.avgrd[i].calls; from.avgrd[i].calls = 0; 31 to.avgrd[i].bytes += from.avgrd[i].bytes; from.avgrd[i].bytes = 0; 28 32 }; 29 33 } … … 36 40 37 41 void push(acceptor_stats_t & from, acceptor_stats_t & to) { 38 __atomic_fetch_add(&to.creates, from.creates, __ATOMIC_RELAXED); from.creates = 0;39 __atomic_fetch_add(&to.accepts, from.accepts, __ATOMIC_RELAXED); from.accepts = 0;40 __atomic_fetch_add(&to.eagains, from.eagains, __ATOMIC_RELAXED); from.eagains = 0;42 to.creates += from.creates; from.creates = 0; 43 to.accepts += from.accepts; from.accepts = 0; 44 to.eagains += from.eagains; from.eagains = 0; 41 45 } 42 46 … … 53 57 void main(StatsPrinter & this) { 54 58 LOOP: for() { 55 waitfor( ^?{} : this) {56 break LOOP;57 }58 or else {}59 60 59 wait(this.var, 10`s); 61 60 … … 79 78 80 79 double ratio = ((double)tries) / calls; 80 uint64_t accp_open = this.stats.accpt.accepts; 81 uint64_t accp_clse = this.stats.send.close; 82 uint64_t accp_live = accp_open - accp_clse; 81 83 82 if(this.stats.accpt.accepts > 0) { 83 sout | "----- Acceptor Stats -----"; 84 sout | "accept : " | eng3(this.stats.accpt.accepts) | "calls," | eng3(this.stats.accpt.eagains) | "eagains," | eng3(this.stats.accpt.creates) | " thrds"; 85 sout | nl; 86 } 84 sout | "----- Acceptor Stats -----"; 85 sout | "accepts : " | eng3(accp_open) |"opened," | eng3(accp_clse) |"closed," | eng3(accp_live) |"live"; 86 sout | "accept : " | eng3(this.stats.accpt.accepts) | "calls," | eng3(this.stats.accpt.eagains) | "eagains," | eng3(this.stats.accpt.creates) | " thrds"; 87 sout | nl; 87 88 88 89 sout | "----- Connection Stats -----"; 90 sout | "max fd : " | this.stats.send.maxfd; 89 91 sout | "sendfile : " | eng3(calls) | "calls," | eng3(tries) | "tries (" | ratio | " try/call)"; 90 92 sout | " " | eng3(header) | "header," | eng3(splcin) | "splice in," | eng3(splcot) | "splice out"; … … 95 97 } 96 98 } 99 100 waitfor( ^?{} : this) { 101 break LOOP; 102 } 103 or else {} 97 104 } 98 105 } -
benchmark/io/http/printer.hfa
r563a36b rae020ea 10 10 11 11 struct sendfile_stats_t { 12 volatile uint64_t maxfd; 13 volatile uint64_t close; 12 14 volatile uint64_t calls; 13 15 volatile uint64_t tries;
Note: See TracChangeset
for help on using the changeset viewer.