Skip to content

Instantly share code, notes, and snippets.

@frenchbread
Created September 29, 2016 21:53
Show Gist options
  • Save frenchbread/7284f24b0c224ee70b3c3ebd3cb1ef94 to your computer and use it in GitHub Desktop.
Save frenchbread/7284f24b0c224ee70b3c3ebd3cb1ef94 to your computer and use it in GitHub Desktop.
-spec get_timestamp() -> integer().
get_timestamp() ->
{Mega, Sec, Micro} = os:timestamp(),
(Mega*1000000 + Sec)*1000 + round(Micro/1000).
tpl2str(Req) ->
Timestamp = get_timestamp(),
{_,[_,Method,Path|Rest]} = Req,
Bucket = [Timestamp,{Method,Path}],
lists:flatten(io_lib:format("~p", [Bucket])).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment