Esempio n. 1
0
void
req_server_enqueue_imsgq(struct context *ctx, struct conn *conn, struct msg *msg)
{
    ASSERT(msg->request);
    ASSERT((!conn->client && !conn->proxy) || (!conn->dnode_client && !conn->dnode_server));

    /*
     * timeout clock starts ticking the instant the message is enqueued into
     * the server in_q; the clock continues to tick until it either expires
     * or the message is dequeued from the server out_q
     *
     * noreply request are free from timeouts because client is not interested
     * in the reponse anyway!
     */
    if (!msg->noreply) {
        msg_tmo_insert(msg, conn);
    }

    TAILQ_INSERT_TAIL(&conn->imsg_q, msg, s_tqe);

    if (!conn->dyn_mode) {
       stats_server_incr(ctx, conn->owner, in_queue);
       stats_server_incr_by(ctx, conn->owner, in_queue_bytes, msg->mlen);
    } else {
       struct server_pool *pool = (struct server_pool *) array_get(&ctx->pool, 0);
       stats_pool_incr(ctx, pool, peer_in_queue);
       stats_pool_incr_by(ctx, pool, peer_in_queue_bytes, msg->mlen);
    }
}
static void
dnode_rsp_forward_stats(struct context *ctx, struct server *server, struct msg *msg)
{
	ASSERT(!msg->request);
	stats_pool_incr(ctx, server->owner, peer_responses);
	stats_pool_incr_by(ctx, server->owner, peer_response_bytes, msg->mlen);
}
Esempio n. 3
0
static void
dnode_peer_req_forward_stats(struct context *ctx, struct server *server, struct msg *msg)
{
        ASSERT(msg->request);
        //use only the 1st pool
        //struct server_pool *pool = (struct server_pool *) array_get(&ctx->pool, 0);
        struct server_pool *pool = server->owner;
        stats_pool_incr(ctx, pool, peer_requests);
        stats_pool_incr_by(ctx, pool, peer_request_bytes, msg->mlen);
}
Esempio n. 4
0
void
dnode_req_client_enqueue_omsgq(struct context *ctx, struct conn *conn, struct msg *msg)
{
    ASSERT(msg->request);
    ASSERT(conn->type == CONN_DNODE_PEER_CLIENT);

    log_debug(LOG_VERB, "conn %p enqueue outq %p", conn, msg);
    TAILQ_INSERT_TAIL(&conn->omsg_q, msg, c_tqe);

    //use only the 1st pool
    struct server_pool *pool = (struct server_pool *) array_get(&ctx->pool, 0);
    stats_pool_incr(ctx, pool, dnode_client_out_queue);
    stats_pool_incr_by(ctx, pool, dnode_client_out_queue_bytes, msg->mlen);
}
Esempio n. 5
0
static void
dnode_req_client_enqueue_omsgq(struct context *ctx, struct conn *conn, struct msg *msg)
{
    ASSERT(msg->request);
    ASSERT(conn->type == CONN_DNODE_PEER_CLIENT);

    log_debug(LOG_VERB, "conn %p enqueue outq %p", conn, msg);
    TAILQ_INSERT_TAIL(&conn->omsg_q, msg, c_tqe);

    //use only the 1st pool
    conn->omsg_count++;
    histo_add(&ctx->stats->dnode_client_out_queue, conn->omsg_count);
    stats_pool_incr(ctx, dnode_client_out_queue);
    stats_pool_incr_by(ctx, dnode_client_out_queue_bytes, msg->mlen);
}
Esempio n. 6
0
void
dnode_req_peer_enqueue_omsgq(struct context *ctx, struct conn *conn, struct msg *msg)
{
	ASSERT(msg->request);
	ASSERT(!conn->dnode_client && !conn->dnode_server);

	TAILQ_INSERT_TAIL(&conn->omsg_q, msg, s_tqe);


	/* stats_server_incr(ctx, conn->owner, out_queue); */
	/* stats_server_incr_by(ctx, conn->owner, out_queue_bytes, msg->mlen); */

	//use only the 1st pool
	struct server_pool *pool = (struct server_pool *) array_get(&ctx->pool, 0);
	stats_pool_incr(ctx, pool, peer_out_queue);
	stats_pool_incr_by(ctx, pool, peer_out_queue_bytes, msg->mlen);
}
Esempio n. 7
0
void
dnode_req_peer_enqueue_omsgq(struct context *ctx, struct conn *conn, struct msg *msg)
{
    ASSERT(msg->request);
    ASSERT(conn->type == CONN_DNODE_PEER_SERVER);

    TAILQ_INSERT_TAIL(&conn->omsg_q, msg, s_tqe);
    log_debug(LOG_VERB, "conn %p enqueue outq %d:%d", conn, msg->id, msg->parent_id);

    //use only the 1st pool
    struct server_pool *pool = (struct server_pool *) array_get(&ctx->pool, 0);
    if (conn->same_dc)
        stats_pool_incr(ctx, pool, peer_out_queue);
    else
        stats_pool_incr(ctx, pool, remote_peer_out_queue);
   stats_pool_incr_by(ctx, pool, peer_out_queue_bytes, msg->mlen);
}