4 #include <freeradius-devel/util/acutest.h>
9 #define DEBUG_LVL_SET if (test_verbose_level_ >= 3) fr_debug_lvl = L_DBG_LVL_4 + 1
25 io_time = io_stop -
stats->start;
27 INFO(
"I/O time %pV (%u rps)",
54 memset(&conn_conf, 0,
sizeof(conn_conf));
55 memset(&trunk_conf, 0,
sizeof(trunk_conf));
59 ctx = talloc_init(
"test_ctx");
66 for (i = 0; i < 1000000; i++) {
73 stats.enqueued = 1000000;
static unsigned int fr_dlist_num_elements(fr_dlist_head_t const *head)
Return the number of elements in the dlist.
static void * fr_dlist_head(fr_dlist_head_t const *list_head)
Return the HEAD item of a list or NULL if the list is empty.
Head of a doubly linked list.
void fr_event_service(fr_event_list_t *el)
Service any outstanding timer or file descriptor events.
fr_event_list_t * fr_event_list_alloc(TALLOC_CTX *ctx, fr_event_status_cb_t status, void *status_uctx)
Initialise a new event list.
int fr_event_corral(fr_event_list_t *el, fr_time_t now, bool wait)
Gather outstanding timer and file descriptor events.
Stores all information relating to an event list.
Function prototypes and datatypes for the REST (HTTP) transport.
fr_redis_cluster_thread_t * fr_redis_cluster_thread_alloc(TALLOC_CTX *ctx, fr_event_list_t *el, trunk_conf_t const *tconf)
Allocate per-thread, per-cluster instance.
fr_redis_command_set_t * fr_redis_command_set_alloc(TALLOC_CTX *ctx, request_t *request, fr_redis_command_set_complete_t complete, fr_redis_command_set_fail_t fail, void *rctx)
Allocate a new command set.
fr_redis_pipeline_status_t redis_command_set_enqueue(fr_redis_trunk_t *rtrunk, fr_redis_command_set_t *cmds)
Enqueue a command set on a specific trunk.
redisReply * fr_redis_command_get_result(fr_redis_command_t *cmd)
fr_redis_pipeline_status_t fr_redis_command_preformatted_add(fr_redis_command_set_t *cmds, char const *cmd_str, size_t cmd_len)
Add a preformatted/expanded command to the command set.
fr_redis_trunk_t * fr_redis_trunk_alloc(fr_redis_cluster_thread_t *cluster_thread, fr_redis_io_conf_t const *io_conf)
Allocate a new trunk.
Thread local state for a cluster.
Represents a single command.
Represents a collection of pipelined commands.
Redis asynchronous command pipelining.
@ FR_REDIS_PIPELINE_OK
No failure.
static fr_event_list_t * events
#define fr_time()
Allow us to arbitrarily manipulate time.
static void _command_failed(request_t *request, fr_dlist_head_t *completed, void *rctx)
static void _command_complete(request_t *request, fr_dlist_head_t *completed, void *rctx)
static void test_basic_connection(void)
A time delta, a difference in time measured in nanoseconds.
connection_conf_t const * conn_conf
Connection configuration.
Common configuration parameters for a trunk.
static fr_event_list_t * el
Master include file to access all functions and structures in the library.
#define fr_box_time_delta(_val)