Changes in / [aec20700:a8b87d3]
- Files:
-
- 3 edited
-
benchmark/io/http/printer.cfa (modified) (6 diffs)
-
benchmark/io/http/printer.hfa (modified) (1 diff)
-
libcfa/src/concurrency/kernel/fwd.hfa (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/io/http/printer.cfa
raec20700 ra8b87d3 6 6 7 7 void ?{}( sendfile_stats_t & this ) { 8 this.maxfd = 0;9 this.close = 0;10 8 this.calls = 0; 11 9 this.tries = 0; … … 20 18 21 19 void push(sendfile_stats_t & from, sendfile_stats_t & to) { 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; 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; 29 25 for(i; zipf_cnts) { 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;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; 32 28 }; 33 29 } … … 40 36 41 37 void push(acceptor_stats_t & from, acceptor_stats_t & to) { 42 to.creates += from.creates; from.creates = 0;43 to.accepts += from.accepts; from.accepts = 0;44 to.eagains += from.eagains; from.eagains = 0;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; 45 41 } 46 42 … … 57 53 void main(StatsPrinter & this) { 58 54 LOOP: for() { 55 waitfor( ^?{} : this) { 56 break LOOP; 57 } 58 or else {} 59 59 60 wait(this.var, 10`s); 60 61 … … 78 79 79 80 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;83 81 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; 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 } 88 87 89 88 sout | "----- Connection Stats -----"; 90 sout | "max fd : " | this.stats.send.maxfd;91 89 sout | "sendfile : " | eng3(calls) | "calls," | eng3(tries) | "tries (" | ratio | " try/call)"; 92 90 sout | " " | eng3(header) | "header," | eng3(splcin) | "splice in," | eng3(splcot) | "splice out"; … … 97 95 } 98 96 } 99 100 waitfor( ^?{} : this) {101 break LOOP;102 }103 or else {}104 97 } 105 98 } -
benchmark/io/http/printer.hfa
raec20700 ra8b87d3 10 10 11 11 struct sendfile_stats_t { 12 volatile uint64_t maxfd;13 volatile uint64_t close;14 12 volatile uint64_t calls; 15 13 volatile uint64_t tries; -
libcfa/src/concurrency/kernel/fwd.hfa
raec20700 ra8b87d3 289 289 if( expected == 2p ) { 290 290 while( this.ptr != 1p ) Pause(); 291 /* paranoid */ verify( this.ptr == 1p );291 /* paranoid */ verify( this.ptr != 1p ); 292 292 return true; 293 293 }
Note:
See TracChangeset
for help on using the changeset viewer.