redis-benchmark tool TAPI (tapi_redis_benchmark)
Overview
TAPI to handle redis-benchmark tool. More…
// typedefs typedef struct tapi_redis_benchmark_app tapi_redis_benchmark_app; typedef struct tapi_redis_benchmark_opt tapi_redis_benchmark_opt; typedef struct tapi_redis_benchmark_stat tapi_redis_benchmark_stat; // structs struct tapi_redis_benchmark_app; struct tapi_redis_benchmark_opt; struct tapi_redis_benchmark_stat; // global variables const tapi_redis_benchmark_opt tapi_redis_benchmark_default_opt; // global functions typedef SLIST_HEAD(tapi_redis_benchmark_report, tapi_redis_benchmark_stat); te_errno tapi_redis_benchmark_create(tapi_job_factory_t* factory, const tapi_redis_benchmark_opt* opt, tapi_redis_benchmark_app** app); te_errno tapi_redis_benchmark_start(const tapi_redis_benchmark_app* app); te_errno tapi_redis_benchmark_wait(const tapi_redis_benchmark_app* app, int timeout_ms); te_errno tapi_redis_benchmark_stop(const tapi_redis_benchmark_app* app); te_errno tapi_redis_benchmark_kill(const tapi_redis_benchmark_app* app, int signum); te_errno tapi_redis_benchmark_destroy(tapi_redis_benchmark_app* app); void tapi_redis_benchmark_destroy_report(tapi_redis_benchmark_report* entry); te_errno tapi_redis_benchmark_get_report(tapi_redis_benchmark_app* app, tapi_redis_benchmark_report* report); tapi_redis_benchmark_stat* tapi_redis_benchmark_report_get_stat(tapi_redis_benchmark_report* report, const char* test_name); te_errno tapi_redis_benchmark_report_mi_log(te_mi_logger* logger, tapi_redis_benchmark_report* report); // macros #define TAPI_REDIS_BENCHMARK_RECEIVE_TIMEOUT_MS #define TAPI_REDIS_BENCHMARK_TIMEOUT_MS
Detailed Documentation
TAPI to handle redis-benchmark tool.
Copyright (C) 2022 OKTET Labs Ltd. All rights reserved.
Typedefs
typedef struct tapi_redis_benchmark_app tapi_redis_benchmark_app
Redis-benchmark tool information.
typedef struct tapi_redis_benchmark_opt tapi_redis_benchmark_opt
Specific redis-benchmark options.
typedef struct tapi_redis_benchmark_stat tapi_redis_benchmark_stat
List node with redis-benchmark statistics.
Global Variables
const tapi_redis_benchmark_opt tapi_redis_benchmark_default_opt
Default redis-benchmark options initializer.
Global Functions
typedef SLIST_HEAD(tapi_redis_benchmark_report, tapi_redis_benchmark_stat)
Test stat list entry.
te_errno tapi_redis_benchmark_create(tapi_job_factory_t* factory, const tapi_redis_benchmark_opt* opt, tapi_redis_benchmark_app** app)
Create redis-benchmark app.
Parameters:
factory |
job factory |
opt |
redis-benchmark options |
app |
redis-benchmark app handle |
Returns:
Status code.
te_errno tapi_redis_benchmark_start(const tapi_redis_benchmark_app* app)
Start redis-benchmark.
Parameters:
app |
redis-benchmark app handle |
Returns:
Status code.
te_errno tapi_redis_benchmark_wait(const tapi_redis_benchmark_app* app, int timeout_ms)
Wait for redis-benchmark completion.
Parameters:
app |
redis-benchmark app handle |
timeout_ms |
wait timeout in milliseconds |
Returns:
Status code.
te_errno tapi_redis_benchmark_stop(const tapi_redis_benchmark_app* app)
Stop redis-benchmark. It can be started over with tapi_redis_benchmark_start.
Parameters:
app |
redis-benchmark app handle |
Returns:
Status code.
te_errno tapi_redis_benchmark_kill(const tapi_redis_benchmark_app* app, int signum)
Send a signal to redis-benchmark.
Parameters:
app |
redis-benchmark app handle |
signum |
signal to send |
Returns:
Status code.
te_errno tapi_redis_benchmark_destroy(tapi_redis_benchmark_app* app)
Destroy redis-benchmark.
Parameters:
app |
redis-benchmark app handle |
Returns:
Status code.
void tapi_redis_benchmark_destroy_report(tapi_redis_benchmark_report* entry)
Empty redis-benchmark report list and free it entries.
Parameters:
entry |
report list entry |
te_errno tapi_redis_benchmark_get_report(tapi_redis_benchmark_app* app, tapi_redis_benchmark_report* report)
Get redis-benchmark report.
Parameters:
app |
redis-benchmark app handle |
report |
redis-benchmark statistics report |
Returns:
Status code.
tapi_redis_benchmark_stat* tapi_redis_benchmark_report_get_stat(tapi_redis_benchmark_report* report, const char* test_name)
Get redis-benchmark statistics for a test name.
Parameters:
report |
redis-benchmark report |
test_name |
test name |
Returns:
redis-benchmark statistic or NULL
in case of failure
te_errno tapi_redis_benchmark_report_mi_log(te_mi_logger* logger, tapi_redis_benchmark_report* report)
Add redis-benchmark report to MI logger.
Parameters:
report |
redis-benchmark statistics report |
Returns:
Status code.