A sleep would work at reducing the spinning. I figured we'd get maximum
speed from doing it this way though, since erlang scheduler would just do
it's magic and the change probably happens on another processor. I'm fine
either way.


On Wed, Apr 9, 2014 at 3:18 PM, Reid Draper <notifications@github.com>wrote:

> In test/get_put_monitor_eqc.erl:
>
> > -        OriginalValue ->
> > -            poll_stat_change(Metric, OriginalValue);
> > -        _ ->
> > -            ok
> > +    {_, Secs, _} = os:timestamp(),
> > +    poll_stat_change(Metric, OriginalValue, Secs+?POLL_TIMEOUT).
> > +
> > +poll_stat_change(Metric, OriginalValue, ExpireSecs) ->
> > +    {_, Secs, _} = os:timestamp(),
> > +    case Secs > ExpireSecs of
> > +        true ->
> > +            throw({error, {expired, Metric, OriginalValue}});
> > +        false ->
> > +            case folsom_metrics:get_metric_value(Metric) of
> > +                OriginalValue ->
> > +                    poll_stat_change(Metric, OriginalValue, ExpireSecs);
>
> Is there any downside to just hammering on this metric? Would it behoove
> us to sleep for a bit? Right now we're just spinning.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/basho/riak_kv/pull/867/files#r11454053>
> .
>