Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure stats progress and tag individual stale stats #482

Merged
merged 3 commits into from Dec 23, 2013

Conversation

evanmcc
Copy link
Contributor

@evanmcc evanmcc commented Dec 14, 2013

2.0 version of #467, with additional tagging of individual stale stats, even though the rest of the stat cache and the overall cache timestamps may continue to progress.

cc @rsltrifork @russelldb

@evanmcc
Copy link
Contributor Author

evanmcc commented Dec 14, 2013

should be reviewed with basho/riak_kv#763, see that PR for testing notes and strategies.

{error, Reason} ->
lager:debug("stat calc failed: ~p ~p", [Reason]),
{Reply, State1} =
case OldValue of
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer tag_stale/1 had a clause that matched <<"stale:", _/binary>> and you could lose this case statement, and keep the knowledge about tagging encapsulated in the tag_stale/1 function, or is the state mutation too expensive in that case since you'd be setting State#state{value=V} even if it is unchanged.

@russelldb
Copy link
Member

I like it.

I'm curious about your aggressive short line length policy, though. Sometimes I think it makes the code less readable.

@@ -140,6 +174,12 @@ do_calc_stat(Stat) ->
spawn_link(
fun() ->
StatVal = riak_core_stat_q:calc_stat(Stat),
gen_server:cast(ServerPid, {value, StatVal, folsom_utils:now_epoch()}) end
gen_server:cast(ServerPid, {value, StatVal,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the line break change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one because I thought that it looked better with end easier to match with fun, and the rest because it was long line, which are the most horrible thing in the entire universe.

@russelldb
Copy link
Member

Oh, I meant to say +1

@evanmcc
Copy link
Contributor Author

evanmcc commented Dec 23, 2013

I suppose that sometimes the long-line thing might make things harder to read. I think that in erlang it's particularly bad, because of how the default modes push things to the right quite quickly, especially in anonymous functions, which are handled more like right-hand-rule stuff than just adding another level of scope indention.

Anyway, I can revert, I don't really care, it's just that 80 columns is a hard habit to break.

@evanmcc
Copy link
Contributor Author

evanmcc commented Dec 23, 2013

updated, if you want to take another look.

@russelldb
Copy link
Member

All the ones are plussed. Merge at will. Many thanks.

evanmcc added a commit that referenced this pull request Dec 23, 2013
Ensure stats progress and tag individual stale stats
@evanmcc evanmcc merged commit 02c7cc1 into develop Dec 23, 2013
@seancribbs seancribbs deleted the bugfix/ensure-stats-progress branch April 1, 2015 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants