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

Allow passing of custom MS for per #19

Merged
merged 3 commits into from
Jun 14, 2018

Conversation

darksheik
Copy link
Contributor

I'd like to be able to determine my own interval. I have a case where I need to enforce 1 request every 10 seconds.

Thanks!

@coveralls
Copy link

coveralls commented Jun 13, 2018

Coverage Status

Coverage increased (+0.1%) to 90.805% when pulling a5c814d on darksheik:custom_ms into 814accc on lambdaclass:master.

@facundoolano
Copy link
Contributor

Can you add a test for this?

@darksheik
Copy link
Contributor Author

Sure! I'm honestly more of an Elixir guy and I'm not sure if I'm running the suite correctly...

Common Test v1.13 starting (cwd is /Users/don/workspace/throttle)

Eshell V8.2  (abort with ^G)
ct_run -dir /Users/don/workspace/throttle

(ct@MacBook-Pro)1> 
Common Test: Running make in test directories...

CWD set to: "/Users/don/workspace/throttle/ct_run.ct@MacBook-Pro.2018-06-13_13.49.03"

TEST INFO: 1 test(s), 2 suite(s)

Testing workspace.throttle: Starting test (with repeated test cases)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
throttle_distributed_SUITE:init_per_suite failed
Reason: {badmatch,{error,boot_timeout,'node2@127.0.0.1@MacBook-Pro'}}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Testing workspace.throttle: *** FAILED {throttle_distributed_SUITE,init_per_suite} ***

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
throttle_test_SUITE:init_per_group failed
Reason: {badmatch,{error,{throttle,{"no such file or directory","thr...}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Testing workspace.throttle: *** FAILED {throttle_test_SUITE,init_per_group} ***

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
throttle_test_SUITE:init_per_group failed
Reason: {badmatch,{error,{throttle,{"no such file or directory","thr...}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Testing workspace.throttle: *** FAILED {throttle_test_SUITE,init_per_group} ***
Testing workspace.throttle: TEST COMPLETE, 0 ok, 0 failed, 19 skipped of 19 test cases

Updating /Users/don/workspace/throttle/index.html ... done
Updating /Users/don/workspace/throttle/all_runs.html ... done

@facundoolano
Copy link
Contributor

Did you run them with make test? What version of erlang?

@darksheik
Copy link
Contributor Author

@facundoolano Thanks! That worked. Test added.

@@ -14,7 +14,9 @@ interval(per_hour) ->
interval(per_minute) ->
1000 * 60;
interval(per_second) ->
1000.
1000;
interval(CustomMs) ->
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a when is_integer(CustomMs) here, so we still break on malformed input?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@facundoolano
Copy link
Contributor

Thanks, added one last minor comment.

@facundoolano facundoolano merged commit 27687e1 into lambdaclass:master Jun 14, 2018
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

3 participants