Refactoring of skiplist ranges and support for sst ranges

the Skiplist range code was needlessly complicated.  It may be faster
than the new code, but the complexity delta cannot be support for such a
small change.

This was incovered whilst troubleshooting the initial kv range test.
This commit is contained in:
martinsumner 2016-12-28 15:48:04 +00:00
parent 6e5f5d2d44
commit cbad375373
4 changed files with 270 additions and 103 deletions

View file

@ -19,7 +19,7 @@
-define(GET_LOGPOINT, 160000).
-define(SST_LOGPOINT, 200000).
-define(LOG_LEVEL, [info, warn, error, critical]).
-define(SAMPLE_RATE, 16#F).
-define(SAMPLE_RATE, 1).
-define(LOGBASE, dict:from_list([
@ -377,7 +377,7 @@ head_timing(undefined, SW, Level, R) ->
T0 = timer:now_diff(os:timestamp(), SW),
head_timing_int(undefined, T0, Level, R);
head_timing({N, HeadTimingD}, SW, Level, R) ->
case N band ?SAMPLE_RATE of
case N band (?SAMPLE_RATE - 1) of
0 ->
T0 = timer:now_diff(os:timestamp(), SW),
head_timing_int({N, HeadTimingD}, T0, Level, R);
@ -440,7 +440,7 @@ sst_timing(undefined, SW, TimerType) ->
?SST_LOGPOINT,
"SST01");
sst_timing({N, SSTTimerD}, SW, TimerType) ->
case N band ?SAMPLE_RATE of
case N band (?SAMPLE_RATE - 1) of
0 ->
T0 = timer:now_diff(os:timestamp(), SW),
gen_timing_int({N, SSTTimerD},
@ -468,7 +468,7 @@ get_timing(undefined, SW, TimerType) ->
?GET_LOGPOINT,
"B0014");
get_timing({N, GetTimerD}, SW, TimerType) ->
case N band ?SAMPLE_RATE of
case N band (?SAMPLE_RATE - 1) of
0 ->
T0 = timer:now_diff(os:timestamp(), SW),
gen_timing_int({N, GetTimerD},