Motr  M0
stats_ut.c File Reference
#include "ut/ut.h"
#include "fop/fop.h"
#include "reqh/reqh.h"
#include "reqh/reqh_service.h"
#include "rpc/rpc_opcodes.h"
#include "fop/ut/stats/stats_fom.c"
#include "ut/ut_rpc_machine.h"
Include dependency graph for stats_ut.c:

Go to the source code of this file.

Macros

#define DUMMY_DBNAME   "dummy-db"
 
#define DUMMY_COB_ID   20
 
#define DUMMY_SERVER_ADDR   "0@lo:12345:34:10"
 

Functions

static void test_stats (void)
 
static int ut_stats_service_start (struct m0_reqh_service *service)
 
static void ut_stats_service_stop (struct m0_reqh_service *service)
 
static void ut_stats_service_fini (struct m0_reqh_service *service)
 
static int ut_stats_service_allocate (struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
 
static int test_stats_init (void)
 
static int test_stats_fini (void)
 

Variables

struct m0_fom_type stats_fom_type
 
const struct m0_fom_type_ops fom_stats_type_ops
 
static struct m0_ut_rpc_mach_ctx rmach_ctx
 
static struct m0_reqh_serviceservice
 
static const struct m0_reqh_service_ops ut_stats_service_ops
 
static const struct m0_reqh_service_type_ops ut_stats_service_type_ops
 
struct m0_reqh_service_type ut_stats_service_type
 
struct m0_ut_suite m0_fom_stats_ut
 

Macro Definition Documentation

◆ DUMMY_COB_ID

#define DUMMY_COB_ID   20

Definition at line 32 of file stats_ut.c.

◆ DUMMY_DBNAME

#define DUMMY_DBNAME   "dummy-db"

Definition at line 31 of file stats_ut.c.

◆ DUMMY_SERVER_ADDR

#define DUMMY_SERVER_ADDR   "0@lo:12345:34:10"

Definition at line 33 of file stats_ut.c.

Function Documentation

◆ test_stats()

static void test_stats ( void  )
static

Definition at line 40 of file stats_ut.c.

Here is the call graph for this function:

◆ test_stats_fini()

static int test_stats_fini ( void  )
static

Definition at line 125 of file stats_ut.c.

Here is the call graph for this function:

◆ test_stats_init()

static int test_stats_init ( void  )
static

Definition at line 100 of file stats_ut.c.

Here is the call graph for this function:

◆ ut_stats_service_allocate()

static int ut_stats_service_allocate ( struct m0_reqh_service **  service,
const struct m0_reqh_service_type stype 
)
static

Definition at line 68 of file stats_ut.c.

◆ ut_stats_service_fini()

static void ut_stats_service_fini ( struct m0_reqh_service service)
static

Definition at line 56 of file stats_ut.c.

Here is the call graph for this function:

◆ ut_stats_service_start()

static int ut_stats_service_start ( struct m0_reqh_service service)
static

Definition at line 45 of file stats_ut.c.

◆ ut_stats_service_stop()

static void ut_stats_service_stop ( struct m0_reqh_service service)
static

Definition at line 51 of file stats_ut.c.

Variable Documentation

◆ fom_stats_type_ops

const struct m0_fom_type_ops fom_stats_type_ops

FOM type specific functions for stats FOP.

Definition at line 75 of file stats_fom.c.

◆ m0_fom_stats_ut

struct m0_ut_suite m0_fom_stats_ut
Initial value:
= {
.ts_name = "fom-stats-ut",
.ts_init = test_stats_init,
.ts_fini = test_stats_fini,
.ts_tests = {
{ "stats", test_stats },
{ NULL, NULL }
}
}
#define NULL
Definition: misc.h:38
static void test_stats(void)
Definition: stats_ut.c:40
static int test_stats_fini(void)
Definition: stats_ut.c:125
static int test_stats_init(void)
Definition: stats_ut.c:100

Definition at line 133 of file stats_ut.c.

◆ rmach_ctx

struct m0_ut_rpc_mach_ctx rmach_ctx
static

Definition at line 37 of file stats_ut.c.

◆ service

struct m0_reqh_service* service
static

Definition at line 38 of file stats_ut.c.

◆ stats_fom_type

struct m0_fom_type stats_fom_type

Stats specific FOM type operations vector.

Definition at line 80 of file stats_fom.c.

◆ ut_stats_service_ops

const struct m0_reqh_service_ops ut_stats_service_ops
static
Initial value:
= {
.rso_start = ut_stats_service_start,
.rso_stop = ut_stats_service_stop,
}
static int ut_stats_service_start(struct m0_reqh_service *service)
Definition: stats_ut.c:45
static void ut_stats_service_stop(struct m0_reqh_service *service)
Definition: stats_ut.c:51
static void ut_stats_service_fini(struct m0_reqh_service *service)
Definition: stats_ut.c:56

Definition at line 62 of file stats_ut.c.

◆ ut_stats_service_type

struct m0_reqh_service_type ut_stats_service_type
Initial value:
= {
.rst_name = "M0_CST_STATS__UT",
.rst_level = M0_RS_LEVEL_NORMAL,
.rst_typecode = M0_CST_STATS,
}
static const struct m0_reqh_service_type_ops ut_stats_service_type_ops
Definition: stats_ut.c:84

Definition at line 88 of file stats_ut.c.

◆ ut_stats_service_type_ops

const struct m0_reqh_service_type_ops ut_stats_service_type_ops
static
Initial value:
= {
.rsto_service_allocate = ut_stats_service_allocate
}
static int ut_stats_service_allocate(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
Definition: stats_ut.c:68

Definition at line 84 of file stats_ut.c.