Classes | Macros | Typedefs | Functions | Variables
benchmark-pump.c File Reference
#include "task.h"
#include "uv.h"
#include <math.h>
#include <stdio.h>
Include dependency graph for benchmark-pump.c:

Go to the source code of this file.

Classes

struct  buf_list_s
 
struct  req_list_s
 

Macros

#define MAX_SIMULTANEOUS_CONNECTS   100
 
#define MAX_WRITE_HANDLES   1000
 
#define PRINT_STATS   0
 
#define STATS_COUNT   5
 
#define STATS_INTERVAL   1000 /* msec */
 
#define WRITE_BUFFER_SIZE   8192
 

Typedefs

typedef struct buf_list_s buf_list_t
 
typedef struct req_list_s req_list_t
 

Functions

 BENCHMARK_IMPL (pipe_pump100_client)
 
 BENCHMARK_IMPL (pipe_pump1_client)
 
 BENCHMARK_IMPL (tcp_pump100_client)
 
 BENCHMARK_IMPL (tcp_pump1_client)
 
static void buf_alloc (uv_handle_t *handle, size_t size, uv_buf_t *buf)
 
static void buf_free (const uv_buf_t *buf)
 
static void connect_cb (uv_connect_t *req, int status)
 
static void connection_cb (uv_stream_t *s, int status)
 
static void do_write (uv_stream_t *)
 
static double gbit (int64_t bytes, int64_t passed_ms)
 
 HELPER_IMPL (pipe_pump_server)
 
 HELPER_IMPL (tcp_pump_server)
 
static void maybe_connect_some (void)
 
static void pipe_pump (int n)
 
static void read_cb (uv_stream_t *stream, ssize_t bytes, const uv_buf_t *buf)
 
static void read_show_stats (void)
 
static void read_sockets_close_cb (uv_handle_t *handle)
 
static uv_req_treq_alloc (void)
 
static void req_free (uv_req_t *uv_req)
 
static void show_stats (uv_timer_t *handle)
 
static void start_stats_collection (void)
 
static void tcp_pump (int n)
 
static void write_cb (uv_write_t *req, int status)
 

Variables

static buf_list_tbuf_freelist = NULL
 
static struct sockaddr_in connect_addr
 
static struct sockaddr_in listen_addr
 
static uv_loop_tloop
 
static int max_connect_socket = 0
 
static int max_read_sockets = 0
 
static int64_t nrecv = 0
 
static int64_t nrecv_total = 0
 
static int64_t nsent = 0
 
static int64_t nsent_total = 0
 
static uv_pipe_t pipe_write_handles [MAX_WRITE_HANDLES]
 
static uv_pipe_t pipeServer
 
static int read_sockets = 0
 
static req_list_treq_freelist = NULL
 
static uv_stream_tserver
 
static int64_t start_time
 
static int stats_left = 0
 
static int TARGET_CONNECTIONS
 
static uv_tcp_t tcp_write_handles [MAX_WRITE_HANDLES]
 
static uv_tcp_t tcpServer
 
static uv_timer_t timer_handle
 
static stream_type type
 
static char write_buffer [WRITE_BUFFER_SIZE]
 
static int write_sockets = 0
 

Macro Definition Documentation

◆ MAX_SIMULTANEOUS_CONNECTS

#define MAX_SIMULTANEOUS_CONNECTS   100

Definition at line 31 of file benchmark-pump.c.

◆ MAX_WRITE_HANDLES

#define MAX_WRITE_HANDLES   1000

Definition at line 72 of file benchmark-pump.c.

◆ PRINT_STATS

#define PRINT_STATS   0

Definition at line 33 of file benchmark-pump.c.

◆ STATS_COUNT

#define STATS_COUNT   5

Definition at line 35 of file benchmark-pump.c.

◆ STATS_INTERVAL

#define STATS_INTERVAL   1000 /* msec */

Definition at line 34 of file benchmark-pump.c.

◆ WRITE_BUFFER_SIZE

#define WRITE_BUFFER_SIZE   8192

Definition at line 30 of file benchmark-pump.c.

Typedef Documentation

◆ buf_list_t

typedef struct buf_list_s buf_list_t

◆ req_list_t

typedef struct req_list_s req_list_t

Function Documentation

◆ BENCHMARK_IMPL() [1/4]

BENCHMARK_IMPL ( pipe_pump100_client  )

Definition at line 467 of file benchmark-pump.c.

◆ BENCHMARK_IMPL() [2/4]

BENCHMARK_IMPL ( pipe_pump1_client  )

Definition at line 473 of file benchmark-pump.c.

◆ BENCHMARK_IMPL() [3/4]

BENCHMARK_IMPL ( tcp_pump100_client  )

Definition at line 455 of file benchmark-pump.c.

◆ BENCHMARK_IMPL() [4/4]

BENCHMARK_IMPL ( tcp_pump1_client  )

Definition at line 461 of file benchmark-pump.c.

◆ buf_alloc()

static void buf_alloc ( uv_handle_t handle,
size_t  size,
uv_buf_t buf 
)
static

Definition at line 353 of file benchmark-pump.c.

◆ buf_free()

static void buf_free ( const uv_buf_t buf)
static

Definition at line 369 of file benchmark-pump.c.

◆ connect_cb()

static void connect_cb ( uv_connect_t req,
int  status 
)
static

Definition at line 216 of file benchmark-pump.c.

◆ connection_cb()

static void connection_cb ( uv_stream_t s,
int  status 
)
static

Definition at line 277 of file benchmark-pump.c.

◆ do_write()

static void do_write ( uv_stream_t stream)
static

Definition at line 202 of file benchmark-pump.c.

◆ gbit()

static double gbit ( int64_t  bytes,
int64_t  passed_ms 
)
static

Definition at line 82 of file benchmark-pump.c.

◆ HELPER_IMPL() [1/2]

HELPER_IMPL ( pipe_pump_server  )

Definition at line 399 of file benchmark-pump.c.

◆ HELPER_IMPL() [2/2]

HELPER_IMPL ( tcp_pump_server  )

Definition at line 376 of file benchmark-pump.c.

◆ maybe_connect_some()

static void maybe_connect_some ( void  )
static

Definition at line 244 of file benchmark-pump.c.

◆ pipe_pump()

static void pipe_pump ( int  n)
static

Definition at line 439 of file benchmark-pump.c.

◆ read_cb()

static void read_cb ( uv_stream_t stream,
ssize_t  bytes,
const uv_buf_t buf 
)
static

Definition at line 171 of file benchmark-pump.c.

◆ read_show_stats()

static void read_show_stats ( void  )
static

Definition at line 127 of file benchmark-pump.c.

◆ read_sockets_close_cb()

static void read_sockets_close_cb ( uv_handle_t handle)
static

Definition at line 142 of file benchmark-pump.c.

◆ req_alloc()

static uv_req_t * req_alloc ( void  )
static

Definition at line 318 of file benchmark-pump.c.

◆ req_free()

static void req_free ( uv_req_t uv_req)
static

Definition at line 332 of file benchmark-pump.c.

◆ show_stats()

static void show_stats ( uv_timer_t handle)
static

Definition at line 88 of file benchmark-pump.c.

◆ start_stats_collection()

static void start_stats_collection ( void  )
static

Definition at line 156 of file benchmark-pump.c.

◆ tcp_pump()

static void tcp_pump ( int  n)
static

Definition at line 421 of file benchmark-pump.c.

◆ write_cb()

static void write_cb ( uv_write_t req,
int  status 
)
static

Definition at line 190 of file benchmark-pump.c.

Variable Documentation

◆ buf_freelist

buf_list_t* buf_freelist = NULL
static

Definition at line 350 of file benchmark-pump.c.

◆ connect_addr

struct sockaddr_in connect_addr
static

Definition at line 53 of file benchmark-pump.c.

◆ listen_addr

struct sockaddr_in listen_addr
static

Definition at line 52 of file benchmark-pump.c.

◆ loop

uv_loop_t* loop
static

Definition at line 47 of file benchmark-pump.c.

◆ max_connect_socket

int max_connect_socket = 0
static

Definition at line 57 of file benchmark-pump.c.

◆ max_read_sockets

int max_read_sockets = 0
static

Definition at line 58 of file benchmark-pump.c.

◆ nrecv

int64_t nrecv = 0
static

Definition at line 62 of file benchmark-pump.c.

◆ nrecv_total

int64_t nrecv_total = 0
static

Definition at line 63 of file benchmark-pump.c.

◆ nsent

int64_t nsent = 0
static

Definition at line 64 of file benchmark-pump.c.

◆ nsent_total

int64_t nsent_total = 0
static

Definition at line 65 of file benchmark-pump.c.

◆ pipe_write_handles

uv_pipe_t pipe_write_handles[MAX_WRITE_HANDLES]
static

Definition at line 77 of file benchmark-pump.c.

◆ pipeServer

uv_pipe_t pipeServer
static

Definition at line 50 of file benchmark-pump.c.

◆ read_sockets

int read_sockets = 0
static

Definition at line 59 of file benchmark-pump.c.

◆ req_freelist

req_list_t* req_freelist = NULL
static

Definition at line 315 of file benchmark-pump.c.

◆ server

uv_stream_t* server
static

Definition at line 51 of file benchmark-pump.c.

◆ start_time

int64_t start_time
static

Definition at line 55 of file benchmark-pump.c.

◆ stats_left

int stats_left = 0
static

Definition at line 67 of file benchmark-pump.c.

◆ TARGET_CONNECTIONS

int TARGET_CONNECTIONS
static

Definition at line 29 of file benchmark-pump.c.

◆ tcp_write_handles

uv_tcp_t tcp_write_handles[MAX_WRITE_HANDLES]
static

Definition at line 76 of file benchmark-pump.c.

◆ tcpServer

uv_tcp_t tcpServer
static

Definition at line 49 of file benchmark-pump.c.

◆ timer_handle

uv_timer_t timer_handle
static

Definition at line 79 of file benchmark-pump.c.

◆ type

stream_type type
static

Definition at line 74 of file benchmark-pump.c.

◆ write_buffer

char write_buffer[WRITE_BUFFER_SIZE]
static

Definition at line 69 of file benchmark-pump.c.

◆ write_sockets

int write_sockets = 0
static

Definition at line 60 of file benchmark-pump.c.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:04