ADTast-experimentalpthread-emulationqualifiedEnum
Last change
on this file since 430ce61 was
137974ae,
checked in by Thierry Delisle <tdelisle@…>, 2 years ago
|
Moved stats printer to it's own file and now using push-stats rather than pull
|
-
Property mode set to
100644
|
File size:
979 bytes
|
Rev | Line | |
---|
[137974ae] | 1 | #pragma once |
---|
| 2 | |
---|
| 3 | #include <stdint.h> |
---|
| 4 | |
---|
| 5 | #include <locks.hfa> |
---|
| 6 | #include <thread.hfa> |
---|
| 7 | |
---|
| 8 | extern const size_t zipf_sizes[]; |
---|
| 9 | enum { zipf_cnts = 36, }; |
---|
| 10 | |
---|
| 11 | struct sendfile_stats_t { |
---|
| 12 | volatile uint64_t calls; |
---|
| 13 | volatile uint64_t tries; |
---|
| 14 | volatile uint64_t header; |
---|
| 15 | volatile uint64_t splcin; |
---|
| 16 | volatile uint64_t splcot; |
---|
| 17 | struct { |
---|
| 18 | volatile uint64_t calls; |
---|
| 19 | volatile uint64_t bytes; |
---|
| 20 | } avgrd[zipf_cnts]; |
---|
| 21 | }; |
---|
| 22 | |
---|
| 23 | void ?{}( sendfile_stats_t & this ); |
---|
| 24 | |
---|
| 25 | void push(sendfile_stats_t & from, sendfile_stats_t & to); |
---|
| 26 | |
---|
| 27 | struct acceptor_stats_t { |
---|
| 28 | volatile uint64_t creates; |
---|
| 29 | volatile uint64_t accepts; |
---|
| 30 | volatile uint64_t eagains; |
---|
| 31 | }; |
---|
| 32 | |
---|
| 33 | void ?{}( acceptor_stats_t & this ); |
---|
| 34 | |
---|
| 35 | void push(acceptor_stats_t & from, acceptor_stats_t & to); |
---|
| 36 | |
---|
| 37 | thread StatsPrinter { |
---|
| 38 | struct { |
---|
| 39 | __spinlock_t lock; |
---|
| 40 | sendfile_stats_t send; |
---|
| 41 | acceptor_stats_t accpt; |
---|
| 42 | } stats; |
---|
| 43 | condition_variable(fast_block_lock) var; |
---|
| 44 | }; |
---|
| 45 | |
---|
| 46 | void ?{}( StatsPrinter & this, cluster & cl ); |
---|
| 47 | void ^?{}( StatsPrinter & mutex this ); |
---|
| 48 | |
---|
| 49 | extern StatsPrinter * stats_thrd; |
---|
Note: See
TracBrowser
for help on using the repository browser.