source: benchmark/io/http/printer.hfa @ ae020ea

pthread-emulationqualifiedEnum
Last change on this file since ae020ea was ae020ea, checked in by Thierry Delisle <tdelisle@…>, 6 months ago

Printer now prints max fd and open/closed/live connections.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1#pragma once
2
3#include <stdint.h>
4
5#include <locks.hfa>
6#include <thread.hfa>
7
8extern const size_t zipf_sizes[];
9enum { zipf_cnts = 36, };
10
11struct sendfile_stats_t {
12        volatile uint64_t maxfd;
13        volatile uint64_t close;
14        volatile uint64_t calls;
15        volatile uint64_t tries;
16        volatile uint64_t header;
17        volatile uint64_t splcin;
18        volatile uint64_t splcot;
19        struct {
20                volatile uint64_t calls;
21                volatile uint64_t bytes;
22        } avgrd[zipf_cnts];
23};
24
25void ?{}( sendfile_stats_t & this );
26
27void push(sendfile_stats_t & from, sendfile_stats_t & to);
28
29struct acceptor_stats_t {
30        volatile uint64_t creates;
31        volatile uint64_t accepts;
32        volatile uint64_t eagains;
33};
34
35void ?{}( acceptor_stats_t & this );
36
37void push(acceptor_stats_t & from, acceptor_stats_t & to);
38
39struct ServerCluster {
40        cluster self;
41        processor    * procs;
42};
43
44thread StatsPrinter {
45        struct {
46                __spinlock_t lock;
47                sendfile_stats_t send;
48                acceptor_stats_t accpt;
49        } stats;
50        condition_variable(fast_block_lock) var;
51        ServerCluster * cl;
52};
53
54void ?{}( StatsPrinter & this, ServerCluster * cl );
55void ^?{}( StatsPrinter & mutex this );
56
57extern StatsPrinter * stats_thrd;
Note: See TracBrowser for help on using the repository browser.