You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2014/08/28 14:23:10 UTC

[50/50] mem3 commit: updated refs/heads/master to 64c0c74

Update to use couch_stats


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/commit/64c0c747
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/tree/64c0c747
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/diff/64c0c747

Branch: refs/heads/master
Commit: 64c0c7475ccf2ea9b4f87b6d287850d7b230c089
Parents: 5668712
Author: Paul J. Davis <pa...@gmail.com>
Authored: Thu Aug 21 01:29:28 2014 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Thu Aug 21 01:29:28 2014 -0500

----------------------------------------------------------------------
 priv/stats_descriptions.cfg | 12 ++++++++++++
 src/mem3.app.src            |  3 ++-
 src/mem3_shards.erl         |  3 +++
 3 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/64c0c747/priv/stats_descriptions.cfg
----------------------------------------------------------------------
diff --git a/priv/stats_descriptions.cfg b/priv/stats_descriptions.cfg
new file mode 100644
index 0000000..a564dd9
--- /dev/null
+++ b/priv/stats_descriptions.cfg
@@ -0,0 +1,12 @@
+{[dbcore, mem3, shard_cache, eviction], [
+    {type, counter},
+    {desc, <<"number of shard cache evictions">>}
+]}.
+{[dbcore, mem3, shard_cache, hit], [
+    {type, counter},
+    {desc, <<"number of shard cache hits">>}
+]}.
+{[dbcore, mem3, shard_cache, miss], [
+    {type, counter},
+    {desc, <<"number of shard cache misses">>}
+]}.

http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/64c0c747/src/mem3.app.src
----------------------------------------------------------------------
diff --git a/src/mem3.app.src b/src/mem3.app.src
index 79f2119..87eda0d 100644
--- a/src/mem3.app.src
+++ b/src/mem3.app.src
@@ -46,6 +46,7 @@
         couch,
         rexi,
         couch_log,
-        couch_event
+        couch_event,
+        couch_stats
     ]}
 ]}.

http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/64c0c747/src/mem3_shards.erl
----------------------------------------------------------------------
diff --git a/src/mem3_shards.erl b/src/mem3_shards.erl
index 4557e1c..b0d22ac 100644
--- a/src/mem3_shards.erl
+++ b/src/mem3_shards.erl
@@ -158,11 +158,14 @@ handle_call(_Call, _From, St) ->
     {noreply, St}.
 
 handle_cast({cache_hit, DbName}, St) ->
+    couch_stats:increment_counter([dbcore, mem3, shard_cache, hit]),
     cache_hit(DbName),
     {noreply, St};
 handle_cast({cache_insert, DbName, Shards}, St) ->
+    couch_stats:increment_counter([dbcore, mem3, shard_cache, miss]),
     {noreply, cache_free(cache_insert(St, DbName, Shards))};
 handle_cast({cache_remove, DbName}, St) ->
+    couch_stats:increment_counter([dbcore, mem3, shard_cache, eviction]),
     {noreply, cache_remove(St, DbName)};
 handle_cast(_Msg, St) ->
     {noreply, St}.