Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:18
rabbitmq-stomp
0001-Do-not-use-time_compat.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Do-not-use-time_compat.patch of Package rabbitmq-stomp
From dbc35db395b07bd9d1c9669886f9320ef7c45e90 Mon Sep 17 00:00:00 2001 From: Daniil Fedotov <dfedotov@pivotal.io> Date: Thu, 12 May 2016 10:23:42 +0100 Subject: [PATCH] Do not use time_compat --- test/src/rabbit_stomp_publish_test.erl | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/test/src/rabbit_stomp_publish_test.erl b/test/src/rabbit_stomp_publish_test.erl index 6ad509e..38d27bd 100644 --- a/test/src/rabbit_stomp_publish_test.erl +++ b/test/src/rabbit_stomp_publish_test.erl @@ -34,14 +34,14 @@ run() -> [put(K, 0) || K <- [sent, recd, last_sent, last_recd]], - put(last_ts, time_compat:monotonic_time()), + put(last_ts, erlang:monotonic_time()), {ok, Pub} = rabbit_stomp_client:connect(), {ok, Recv} = rabbit_stomp_client:connect(), Self = self(), - spawn(fun() -> publish(Self, Pub, 0, time_compat:monotonic_time()) end), + spawn(fun() -> publish(Self, Pub, 0, erlang:monotonic_time()) end), rabbit_stomp_client:send( Recv, "SUBSCRIBE", [{"destination", ?DESTINATION}]), - spawn(fun() -> recv(Self, Recv, 0, time_compat:monotonic_time()) end), + spawn(fun() -> recv(Self, Recv, 0, erlang:monotonic_time()) end), report(). report() -> @@ -49,14 +49,14 @@ report() -> {sent, C} -> put(sent, C); {recd, C} -> put(recd, C) end, - Diff = time_compat:convert_time_unit( - time_compat:monotonic_time() - get(last_ts), native, microseconds), + Diff = erlang:convert_time_unit( + erlang:monotonic_time() - get(last_ts), native, microseconds), case Diff > ?MICROS_PER_UPDATE of true -> S = get(sent) - get(last_sent), R = get(recd) - get(last_recd), put(last_sent, get(sent)), put(last_recd, get(recd)), - put(last_ts, time_compat:monotonic_time()), + put(last_ts, erlang:monotonic_time()), io:format("Send ~p msg/s | Recv ~p msg/s~n", [trunc(S * ?MICROS_PER_SECOND / Diff), trunc(R * ?MICROS_PER_SECOND / Diff)]); @@ -68,12 +68,12 @@ publish(Owner, Client, Count, TS) -> rabbit_stomp_client:send( Client, "SEND", [{"destination", ?DESTINATION}], [integer_to_list(Count)]), - Diff = time_compat:convert_time_unit( - time_compat:monotonic_time() - TS, native, microseconds), + Diff = erlang:convert_time_unit( + erlang:monotonic_time() - TS, native, microseconds), case Diff > ?MICROS_PER_UPDATE_MSG of true -> Owner ! {sent, Count + 1}, publish(Owner, Client, Count + 1, - time_compat:monotonic_time()); + erlang:monotonic_time()); false -> publish(Owner, Client, Count + 1, TS) end. @@ -82,12 +82,12 @@ recv(Owner, Client0, Count, TS) -> rabbit_stomp_client:recv(Client0), BodyInt = list_to_integer(binary_to_list(iolist_to_binary(Body))), Count = BodyInt, - Diff = time_compat:convert_time_unit( - time_compat:monotonic_time() - TS, native, microseconds), + Diff = erlang:convert_time_unit( + erlang:monotonic_time() - TS, native, microseconds), case Diff > ?MICROS_PER_UPDATE_MSG of true -> Owner ! {recd, Count + 1}, recv(Owner, Client1, Count + 1, - time_compat:monotonic_time()); + erlang:monotonic_time()); false -> recv(Owner, Client1, Count + 1, TS) end. -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor