Motr  M0
stats_ut_svc.c File Reference
#include "lib/memory.h"
#include "fop/fop.h"
#include "fop/fom.h"
#include "motr/setup.h"
#include "stats/stats_fops.h"
#include "reqh/reqh_service.h"
#include "stats/stats_api.h"
#include "stats/stats_srv.c"
#include "rpc/ut/clnt_srv_ctx.c"
Include dependency graph for stats_ut_svc.c:

Go to the source code of this file.

Data Structures

struct  fop_rate
 
struct  read_size
 
struct  disk_stats
 

Enumerations

enum  stats_id { UT_STATS_FOP_RATE = 1, UT_STATS_READ_SIZE, UT_STATS_DISK }
 
enum  fop_type { UPDATE_FOP = 1, QUERY_FOP }
 

Functions

static void fill_stats_input ()
 
void check_stats (struct m0_tl *stats_list, int count)
 
static void stats_ut_svc_start_stop ()
 
void fop_release (struct m0_ref *ref)
 
static void test_state_update_fom_fini (struct m0_fom *fom)
 
static struct m0_fopget_fake_stats_fop (uint32_t nsum, enum fop_type type)
 
static void update_fom_test (struct stats_svc *srv, struct m0_reqh *reqh, int count)
 
static void stats_ut_svc_update_fom ()
 
static void test_state_query_fom_fini (struct m0_fom *fom)
 
static void query_fom_test (struct stats_svc *srv, struct m0_reqh *reqh, int count)
 
static void stats_ut_svc_query_fom ()
 
static struct m0_uint64_seqcreate_stats_id_seq (int count)
 
static void check_stats_recs (struct m0_stats_recs *recs, int num)
 
static void stats_svc_query_api ()
 

Variables

struct m0_mutex ut_stats_mutex
 
struct m0_cond ut_stats_cond
 
struct m0_rpc_server_ctx stats_ut_sctx_bk
 
struct m0_rpc_machine ut_stats_machine
 
static char * stats_ut_server_argv []
 
struct fop_rate f_rate
 
struct read_size r_size
 
struct disk_stats d_stats
 
struct m0_stats_sum stats_sum [3]
 
uint64_t stats_ids []
 
static const struct m0_fom_ops ut_stats_update_fom_ops
 
static const struct m0_fom_ops ut_stats_query_fom_ops
 

Enumeration Type Documentation

◆ fop_type

enum fop_type
Enumerator
UPDATE_FOP 
QUERY_FOP 

Definition at line 51 of file stats_ut_svc.c.

◆ stats_id

enum stats_id
Enumerator
UT_STATS_FOP_RATE 
UT_STATS_READ_SIZE 
UT_STATS_DISK 

Definition at line 45 of file stats_ut_svc.c.

Function Documentation

◆ check_stats()

void check_stats ( struct m0_tl stats_list,
int  count 
)

Definition at line 101 of file stats_ut_svc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_stats_recs()

static void check_stats_recs ( struct m0_stats_recs recs,
int  num 
)
static

Definition at line 459 of file stats_ut_svc.c.

Here is the caller graph for this function:

◆ create_stats_id_seq()

static struct m0_uint64_seq* create_stats_id_seq ( int  count)
static

Definition at line 441 of file stats_ut_svc.c.

Here is the caller graph for this function:

◆ fill_stats_input()

static void fill_stats_input ( )
static

Definition at line 79 of file stats_ut_svc.c.

Here is the caller graph for this function:

◆ fop_release()

void fop_release ( struct m0_ref ref)

Definition at line 148 of file stats_ut_svc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_fake_stats_fop()

static struct m0_fop* get_fake_stats_fop ( uint32_t  nsum,
enum fop_type  type 
)
static

Definition at line 175 of file stats_ut_svc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ query_fom_test()

static void query_fom_test ( struct stats_svc srv,
struct m0_reqh reqh,
int  count 
)
static

Definition at line 350 of file stats_ut_svc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stats_svc_query_api()

static void stats_svc_query_api ( )
static

Definition at line 469 of file stats_ut_svc.c.

Here is the call graph for this function:

◆ stats_ut_svc_query_fom()

static void stats_ut_svc_query_fom ( )
static

Definition at line 391 of file stats_ut_svc.c.

Here is the call graph for this function:

◆ stats_ut_svc_start_stop()

static void stats_ut_svc_start_stop ( )
static

Definition at line 112 of file stats_ut_svc.c.

Here is the call graph for this function:

◆ stats_ut_svc_update_fom()

static void stats_ut_svc_update_fom ( )
static

Definition at line 250 of file stats_ut_svc.c.

Here is the call graph for this function:

◆ test_state_query_fom_fini()

static void test_state_query_fom_fini ( struct m0_fom fom)
static

Definition at line 315 of file stats_ut_svc.c.

Here is the call graph for this function:

◆ test_state_update_fom_fini()

static void test_state_update_fom_fini ( struct m0_fom fom)
static

Definition at line 157 of file stats_ut_svc.c.

Here is the call graph for this function:

◆ update_fom_test()

static void update_fom_test ( struct stats_svc srv,
struct m0_reqh reqh,
int  count 
)
static

Definition at line 208 of file stats_ut_svc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ d_stats

struct disk_stats d_stats

◆ f_rate

struct fop_rate f_rate

◆ r_size

struct read_size r_size

◆ stats_ids

uint64_t stats_ids[]

◆ stats_sum

struct m0_stats_sum stats_sum[3]

Definition at line 72 of file stats_ut_svc.c.

◆ stats_ut_sctx_bk

struct m0_rpc_server_ctx stats_ut_sctx_bk

Definition at line 34 of file stats_ut_svc.c.

◆ stats_ut_server_argv

char* stats_ut_server_argv[]
static
Initial value:
= {
"rpclib_ut", "-T", "AD", "-D", SERVER_DB_NAME, "-w", "10",
"-c", M0_UT_PATH("conf.xc")
}
#define SERVER_STOB_NAME
Definition: filterc_ut.c:53
#define SERVER_DB_NAME
Definition: filterc_ut.c:52
#define SERVER_ENDPOINT
Definition: common.h:31
#define SERVER_ADDB_STOB_NAME
Definition: filterc_ut.c:54
#define M0_UT_CONF_PROCESS
Definition: misc.h:45
#define SERVER_ENDPOINT_ADDR
Definition: common.h:30
#define M0_UT_PATH(name)
Definition: misc.h:41

Definition at line 37 of file stats_ut_svc.c.

◆ ut_stats_cond

struct m0_cond ut_stats_cond

Definition at line 33 of file stats_ut_svc.c.

◆ ut_stats_machine

struct m0_rpc_machine ut_stats_machine

Definition at line 35 of file stats_ut_svc.c.

◆ ut_stats_mutex

struct m0_mutex ut_stats_mutex

Definition at line 32 of file stats_ut_svc.c.

◆ ut_stats_query_fom_ops

const struct m0_fom_ops ut_stats_query_fom_ops
static
Initial value:
= {
.fo_home_locality = stats_fom_home_locality,
}
static int stats_query_fom_tick(struct m0_fom *fom)
Definition: stats_srv.c:679
static size_t stats_fom_home_locality(const struct m0_fom *fom)
Definition: stats_srv.c:526
static void test_state_query_fom_fini(struct m0_fom *fom)
Definition: stats_ut_svc.c:315

Fake stats query FOM operation vector to fom. It only override fom_finish op which is wrapper of original one.

Definition at line 344 of file stats_ut_svc.c.

◆ ut_stats_update_fom_ops

const struct m0_fom_ops ut_stats_update_fom_ops
static
Initial value:
= {
.fo_home_locality = stats_fom_home_locality,
}
static int stats_update_fom_tick(struct m0_fom *fom)
Definition: stats_srv.c:485
static size_t stats_fom_home_locality(const struct m0_fom *fom)
Definition: stats_srv.c:526
static void test_state_update_fom_fini(struct m0_fom *fom)
Definition: stats_ut_svc.c:157

Fake stats update FOM operation vector to fom. It only override fom_finish op which is wrapper of original one.

Definition at line 169 of file stats_ut_svc.c.