Skip to content

Commit

Permalink
rearrange the stats output for easier reading. Initialize a few varia…
Browse files Browse the repository at this point in the history
…bles so we don't get some weird numbers.
  • Loading branch information
timiblossom committed Feb 8, 2015
1 parent 0ff45f4 commit f14af6e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/dyn_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion src/dyn_histogram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/dyn_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand All @@ -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;
*/
}


Expand Down
16 changes: 11 additions & 5 deletions src/dyn_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f14af6e

Please sign in to comment.