#pragma once #include #include #include extern const size_t zipf_sizes[]; enum { zipf_cnts = 36, }; struct sendfile_stats_t { volatile uint64_t maxfd; volatile uint64_t close; volatile uint64_t calls; volatile uint64_t tries; volatile uint64_t header; volatile uint64_t splcin; volatile uint64_t splcot; struct { volatile uint64_t calls; volatile uint64_t bytes; } avgrd[zipf_cnts]; }; void ?{}( sendfile_stats_t & this ); void push(sendfile_stats_t & from, sendfile_stats_t & to); struct acceptor_stats_t { volatile uint64_t creates; volatile uint64_t accepts; volatile uint64_t eagains; }; void ?{}( acceptor_stats_t & this ); void push(acceptor_stats_t & from, acceptor_stats_t & to); struct ServerCluster { cluster self; processor * procs; }; thread StatsPrinter { struct { __spinlock_t lock; sendfile_stats_t send; acceptor_stats_t accpt; } stats; condition_variable(fast_block_lock) var; ServerCluster * cl; }; void ?{}( StatsPrinter & this, ServerCluster * cl ); void ^?{}( StatsPrinter & mutex this ); extern StatsPrinter * stats_thrd;