diff --git a/src/dyn_core.c b/src/dyn_core.c index ee2fbca7f..99e9cb72e 100644 --- a/src/dyn_core.c +++ b/src/dyn_core.c @@ -233,9 +233,9 @@ core_start(struct instance *nci) if (ctx != NULL) { nci->ctx = ctx; - if (get_tracking_level() >= LOG_VVERB) { - crypto_check(); - } + if (get_tracking_level() >= LOG_VVERB) { + crypto_check(); + } return ctx; } @@ -572,9 +572,9 @@ core_loop(struct context *ctx) { int nsd; - //log_debug(LOG_VERB, "timeout = %d", ctx->timeout); + log_debug(LOG_VERB, "timeout = %d", ctx->timeout); - core_process_messages(); + core_process_messages(); nsd = event_wait(ctx->evb, ctx->timeout); if (nsd < 0) { return nsd; diff --git a/src/dyn_histogram.c b/src/dyn_histogram.c index 7f6226fde..58383e644 100644 --- a/src/dyn_histogram.c +++ b/src/dyn_histogram.c @@ -229,7 +229,9 @@ void histo_compute_latencies(uint64_t* mean, uint64_t* latency_95th, } - *mean = ceil((double) sum / elements); + if (elements != 0) + *mean = ceil((double) sum / elements); + *latency_95th = val_95th; *latency_99th = val_99th; *latency_999th = val_999th; diff --git a/src/dyn_request.c b/src/dyn_request.c index b71e1412d..74543b508 100644 --- a/src/dyn_request.c +++ b/src/dyn_request.c @@ -532,6 +532,9 @@ static bool request_send_to_all_racks(struct msg *msg) { msg_type_t t = msg->type; + return msg->is_read? 0 : 1; + + /* if (msg->redis) { return t == MSG_REQ_REDIS_SET || t == MSG_REQ_REDIS_DEL || t == MSG_REQ_REDIS_DECR || t == MSG_REQ_REDIS_HDEL || t == MSG_REQ_REDIS_HSET || t == MSG_REQ_REDIS_INCR || t == MSG_REQ_REDIS_LPOP || t == MSG_REQ_REDIS_LREM || @@ -545,6 +548,7 @@ request_send_to_all_racks(struct msg *msg) { return t == MSG_REQ_MC_SET || t == MSG_REQ_MC_CAS || t == MSG_REQ_MC_DELETE || t == MSG_REQ_MC_ADD || t == MSG_REQ_MC_REPLACE || t == MSG_REQ_MC_APPEND || t == MSG_REQ_MC_PREPEND || t == MSG_REQ_MC_INCR || t == MSG_REQ_MC_DECR; + */ } diff --git a/src/dyn_stats.c b/src/dyn_stats.c index 428d81070..1d4a326ea 100644 --- a/src/dyn_stats.c +++ b/src/dyn_stats.c @@ -563,27 +563,27 @@ stats_add_header(struct stats *st) return status; } - status = stats_add_num(st, &st->latency_999th_str, st->latency_999th); + status = stats_add_num(st, &st->latency_max_str, st->latency_max); if (status != DN_OK) { return status; } - status = stats_add_num(st, &st->latency_99th_str, st->latency_99th); + status = stats_add_num(st, &st->latency_999th_str, st->latency_999th); if (status != DN_OK) { return status; } - status = stats_add_num(st, &st->latency_95th_str, st->latency_95th); + status = stats_add_num(st, &st->latency_99th_str, st->latency_99th); if (status != DN_OK) { return status; } - status = stats_add_num(st, &st->latency_mean_str, st->latency_mean); + status = stats_add_num(st, &st->latency_95th_str, st->latency_95th); if (status != DN_OK) { return status; } - status = stats_add_num(st, &st->latency_max_str, st->latency_max); + status = stats_add_num(st, &st->latency_mean_str, st->latency_mean); if (status != DN_OK) { return status; } @@ -1134,6 +1134,12 @@ stats_create(uint16_t stats_port, char *stats_ip, int stats_interval, st->updated = 0; st->aggregate = 0; + st->latency_95th = 0; + st->latency_999th = 0; + st->latency_99th = 0; + st->latency_max = 0; + st->latency_mean = 0; + /* map server pool to current (a), shadow (b) and sum (c) */ status = stats_pool_map(&st->current, server_pool);