Skip to content

Commit

Permalink
Merge ebf5aa4 into b5e0c37
Browse files Browse the repository at this point in the history
  • Loading branch information
joesanford committed Nov 7, 2019
2 parents b5e0c37 + ebf5aa4 commit 1dc8063
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/statsderl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ timing(Key, Value, Rate) ->
statsderl_pool:sample(Rate, {timing, Key, Value}).

-spec timing_fun(key(), fun(), sample_rate()) ->
ok.
any().

timing_fun(Key, Fun, Rate) ->
Timestamp = statsderl_utils:timestamp(),
Expand Down
4 changes: 3 additions & 1 deletion test/statsderl_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ timing_fun_subtest(Socket) ->
meck:new(statsderl_utils, [passthrough, no_history]),
Seq = meck:loop([{1448, 573975, 400000}, {1448, 573975, 500000}]),
meck:expect(statsderl_utils, timestamp, [], Seq),
statsderl:timing_fun("test", fun () -> ok end, 1),
TestResult = "testresult",
Result = statsderl:timing_fun("test", fun () -> TestResult end, 1),
assert_packet(Socket, <<"test:100|ms">>),
?assertEqual(Result, TestResult),
meck:unload(statsderl_utils).

timing_subtest(Socket) ->
Expand Down

0 comments on commit 1dc8063

Please sign in to comment.