X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=nfs3%2Frpc.c;h=5341f20c3432f270ae497e2b9ecc9ba00b4ef771;hb=ea7099e8f1f6319cf6d20087d71209fa79cecf6f;hp=dbe0a64b67b20f992b14bdb5a8666b9857a1d186;hpb=348aaaad42163d6829112c9b18026c16b09e1914;p=bluesky.git diff --git a/nfs3/rpc.c b/nfs3/rpc.c index dbe0a64..5341f20 100644 --- a/nfs3/rpc.c +++ b/nfs3/rpc.c @@ -28,6 +28,7 @@ extern BlueSkyFS *fs; static int outstanding_rpcs = 0; +static struct bluesky_stats *rpc_recv_stats, *rpc_send_stats; /* TCP port number to use for NFS protocol. (Should be 2049.) */ #define NFS_SERVICE_PORT 2051 @@ -194,6 +195,7 @@ async_rpc_send_reply(RPCRequest *req, void *result) } g_atomic_int_add(&outstanding_rpcs, -1); + bluesky_stats_add(rpc_send_stats, str->len); struct rpc_reply header; header.xid = htonl(req->xid); @@ -569,6 +571,8 @@ static gboolean async_rpc_dispatch(RPCConnection *rpc) GString *msg = rpc->msgbuf; const char *buf = msg->str; + bluesky_stats_add(rpc_recv_stats, msg->len); + if (msg->len < sizeof(struct rpc_call_header)) { fprintf(stderr, "Short RPC message: only %zd bytes!\n", msg->len); return FALSE; @@ -861,6 +865,9 @@ void register_rpc() { SVCXPRT *transp; + rpc_recv_stats = bluesky_stats_new("NFS RPC Messages In"); + rpc_send_stats = bluesky_stats_new("NFS RPC Messages Out"); + async_rpc_init(); /* MOUNT protocol */