Permalink
Browse files

Fewer calls to slide:moment/0

  • Loading branch information...
1 parent 61435d1 commit 024129075907611750cf35e62646cfd6aa44e0cf @russelldb committed Apr 4, 2012
Showing with 12 additions and 9 deletions.
  1. +12 −9 src/riak_kv_stat.erl
View
@@ -254,27 +254,30 @@ update(vnode_put) ->
riak_core_metric_proc:update(?APP, vnode_puts_total, 1);
update(vnode_index_read) ->
riak_core_metric_proc:update(?APP, vnode_index_reads, {1, slide:moment()}),
- riak_core_metric_counter:increment(?APP, vnode_index_reads_total);
+ riak_core_metric_proc:update(?APP, vnode_index_reads_total, 1);
update({vnode_index_write, PostingsAdded, PostingsRemoved}) ->
- riak_core_metric_proc:update(?APP, vnode_index_writes, {1, slide:moment()}),
+ Moment = slide:moment(),
+ riak_core_metric_proc:update(?APP, vnode_index_writes, {1, Moment}),
riak_core_metric_proc:update(?APP, vnode_index_writes_total, 1),
- riak_core_metric_proc:update(?APP, vnode_index_writes_postings, {PostingsAdded, slide:moment()}),
+ riak_core_metric_proc:update(?APP, vnode_index_writes_postings, {PostingsAdded, Moment}),
riak_core_metric_proc:update(?APP, vnode_index_writes_postings_total, PostingsAdded),
- riak_core_metric_proc:update(?APP, vnode_index_deletes_postings, {PostingsRemoved, slide:moment()}),
+ riak_core_metric_proc:update(?APP, vnode_index_deletes_postings, {PostingsRemoved, Moment}),
riak_core_metric_proc:update(?APP, vnode_index_deletes_postings_total, PostingsRemoved);
update({vnode_index_delete, Postings}) ->
- riak_core_metric_proc:update(?APP, vnode_index_deletes, {1, slide:moment()}),
+ Moment = slide:moment(),
+ riak_core_metric_proc:update(?APP, vnode_index_deletes, {1, Moment}),
riak_core_metric_proc:update(?APP, vnode_index_deletes_total, 1),
- riak_core_metric_proc:update(?APP, vnode_index_deletes_postings, {Postings, slide:moment()}),
+ riak_core_metric_proc:update(?APP, vnode_index_deletes_postings, {Postings, Moment}),
riak_core_metric_proc:update(?APP, vnode_index_deletes_postings_total, Postings);
update({get_fsm, _Bucket, Microsecs, undefined, undefined}) ->
riak_core_metric_proc:update(?APP, get_fsm_time, {Microsecs, slide:moment()}),
riak_core_metric_proc:update(?APP, node_gets_total, 1);
update({get_fsm, _Bucket, Microsecs, NumSiblings, ObjSize}) ->
- riak_core_metric_proc:update(?APP, get_fsm_time, {Microsecs, slide:moment()}),
+ Moment = slide:moment(),
+ riak_core_metric_proc:update(?APP, get_fsm_time, {Microsecs, Moment}),
riak_core_metric_proc:update(?APP, node_gets_total, 1),
- riak_core_metric_proc:update(?APP, node_get_fsm_siblings, {NumSiblings, slide:moment()}),
- riak_core_metric_proc:update(?APP, node_get_fsm_objsize, {ObjSize, slide:moment()});
+ riak_core_metric_proc:update(?APP, node_get_fsm_siblings, {NumSiblings, Moment}),
+ riak_core_metric_proc:update(?APP, node_get_fsm_objsize, {ObjSize, Moment});
update({get_fsm_time, Microsecs}) ->
update({get_fsm, undefined, Microsecs, undefined, undefined});
update({put_fsm_time, Microsecs}) ->

0 comments on commit 0241290

Please sign in to comment.