-
Notifications
You must be signed in to change notification settings - Fork 96
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
Introduce Exometer #1165
Introduce Exometer #1165
Conversation
kuenishi
commented
Jun 16, 2015
- Change result of /riak-cs/stats to flat JSON object style
- Add `riak-cs-admin status' command
- Move from folsom to Exometer
- Change names of several metrics to Riak way
Added _[posted via JIRA by Kota Uenishi]_ |
TODOs
|
81932b7
to
74ea3cc
Compare
* Change result of /riak-cs/stats to flat JSON object style * Add `riak-cs-admin status' command * Move from folsom to Exometer * Change names of several metrics to Riak way * Add result of 'riak-cs-admin status' in riak-cs-debug pack
74ea3cc
to
00dc755
Compare
(riak-cs@127.0.0.1)20> Rep = fun(List) -> timer:tc(fun() -> [riak_cs_stats:update([block, get, retry], 10000)||_<-List] end)end.
#Fun<erl_eval.6.80484245>
(riak-cs@127.0.0.1)21> M = fun() -> io:format("~p~n", [element(1, Rep(lists:seq(1,1000000)))]) end.
#Fun<erl_eval.20.80484245>
(riak-cs@127.0.0.1)17> [spawn(M)||_<-lists:seq(1,10)].
[<0.718.0>,<0.719.0>,<0.720.0>,<0.721.0>,<0.722.0>,
<0.723.0>,<0.724.0>,<0.725.0>,<0.726.0>,<0.727.0>]
12275031
12447881
12566408
12791156
15421717
15301850
15380236
15430211
15720915
16101178
(riak-cs@127.0.0.1)18> [spawn(M)||_<-lists:seq(1,3)].
[<0.729.0>,<0.730.0>,<0.731.0>]
7994062
8005765
8313832 A single process, requires ~6 seconds to process a million |
Another round of microbenchmark: (riak-cs@127.0.0.1)5> Self = self().
<0.578.0>
(riak-cs@127.0.0.1)6> TestFun = fun(Concurrency, Rep) -> {Lat,_} = timer:tc(fun() ->[receive done -> ok end || _Pid <- [spawn(fun()
(riak-cs@127.0.0.1)6> ->[riak_cs_stats:update([block, get, retry], 10000)||_<- lists:seq(1, Rep)], Self!done end)||_<- lists:seq(1, Concurrency)]] end),
(riak-cs@127.0.0.1)6> Concurrency * Rep * 1000000 / Lat end.
#Fun<erl_eval.12.80484245>
(riak-cs@127.0.0.1)7> TestFun(1,1).
4098.360655737705
(riak-cs@127.0.0.1)8> TestFun(10,10).
42087.54208754209
(riak-cs@127.0.0.1)9> TestFun(10,100).
180603.21473722233
(riak-cs@127.0.0.1)10> TestFun(10,1000).
316896.9451134491
(riak-cs@127.0.0.1)11> TestFun(1,1000000).
147176.8463740114
(riak-cs@127.0.0.1)12> TestFun(2,1000000).
273493.4272692092
(riak-cs@127.0.0.1)13> TestFun(4,1000000).
488571.27955718833
(riak-cs@127.0.0.1)14> TestFun(8,1000000).
512455.58531427843
(riak-cs@127.0.0.1)15> TestFun(16,1000000).
562100.4344193208
(riak-cs@127.0.0.1)16> TestFun(32,1000000).
541355.426770107 On my 8 core i7 Desktop box, it looks like |
I believe this is ready for review. _[posted via JIRA by Kota Uenishi]_ |
@@ -357,7 +357,6 @@ maybe_backpressure_sleep(Siblings, _BackpressureThreshold) -> | |||
Delta = MeanSleepMS div 2, | |||
SleepMS = crypto:rand_uniform(MeanSleepMS - Delta, MeanSleepMS + Delta), | |||
lager:debug("maybe_backpressure_sleep: Siblings=~p, SleepMS=~p~n", [Siblings, SleepMS]), | |||
ok = riak_cs_stats:update(manifest_siblings_bp_sleep, SleepMS * 1000), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is kludge, bue we have no means whether backpressure sleep happened or not except this stats.
If new stats system has counter, it is sufficient just to count up here.
This PR's aim is to introduce exometer, so It can be deferred to a part of #961.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will deprecate this. And remove in future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In another pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Now |
Updated ^^; |
Updated again, found a typo bug ^^; |
|
Will add a commit removing that. _[posted via JIRA by Kota Uenishi]_ |
@@ -33,6 +34,11 @@ | |||
%%% Public API | |||
%%%=================================================================== | |||
|
|||
status([]) -> | |||
Stats = lists:sort(riak_cs_stats:get_stats()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need sort here? This sorting orders item as 100
-> 95
-> 99
:
block_get_retry_time_100 : 0
block_get_retry_time_95 : 0
block_get_retry_time_99 : 0
block_get_retry_time_mean : 0
block_get_retry_time_median : 0
On the other hand, JSON output is, for me, more human friendly:
"block_get_retry_time_mean": 0,
"block_get_retry_time_median": 0,
"block_get_retry_time_95": 0,
"block_get_retry_time_99": 0,
"block_get_retry_time_100": 0,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ffmm, maybe sort could be done by external command like sort(1). Will update.
All riak_test passed. Code diff looks nice ➕ |
Just a memo for self, license for added repos.
|
Introduce Exometer Reviewed-by: shino
@borshop merge |
See RCS-110 (#654) for release notes. _[posted via JIRA by Kota Uenishi]_ |