Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Merge pull request #38 from cloudant/17185-reduce-log-spam
Replace cache miss log with metrics

BugzID: 17185
  • Loading branch information
kocolosk committed Feb 21, 2013
2 parents 5e24a89 + 20087f2 commit 2e9b66bc3fb5d4267530d54c894917d5718ff0e0
Showing 1 changed file with 3 additions and 1 deletion.
@@ -129,11 +129,14 @@ handle_call(_Call, _From, St) ->
{noreply, St}.

handle_cast({cache_hit, DbName}, St) ->
margaret_counter:increment([dbcore, mem3, shard_cache, hit]),
cache_hit(DbName),
{noreply, St};
handle_cast({cache_insert, DbName, Shards}, St) ->
margaret_counter:increment([dbcore, mem3, shard_cache, miss]),
{noreply, cache_free(cache_insert(St, DbName, Shards))};
handle_cast({cache_remove, DbName}, St) ->
margaret_counter:increment([dbcore, mem3, shard_cache, eviction]),
{noreply, cache_remove(St, DbName)};
handle_cast(_Msg, St) ->
{noreply, St}.
@@ -236,7 +239,6 @@ load_shards_from_disk(DbName) when is_binary(DbName) ->
load_shards_from_db(#db{} = ShardDb, DbName) ->
case couch_db:open_doc(ShardDb, DbName, []) of
{ok, #doc{body = {Props}}} ->
twig:log(notice, "dbs cache miss for ~s", [DbName]),
Shards = mem3_util:build_shards(DbName, Props),
gen_server:cast(?MODULE, {cache_insert, DbName, Shards}),
Shards;

0 comments on commit 2e9b66b

Please sign in to comment.