diff options
| author | Michael Klishin <michael@rabbitmq.com> | 2014-06-20 14:10:09 +0400 |
|---|---|---|
| committer | Michael Klishin <michael@rabbitmq.com> | 2014-06-20 14:10:09 +0400 |
| commit | 1022fb2f136a35f1702d8c0b30d338d21a5d81b9 (patch) | |
| tree | 88ae5bb2c59adea9ec0e2cce6eb17609acbe08ba /src | |
| parent | dbd01a10f5bf289c175385672ba20bea05038009 (diff) | |
| download | rabbitmq-server-git-1022fb2f136a35f1702d8c0b30d338d21a5d81b9.tar.gz | |
Format connected_at info item
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_reader.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl index a45871fb70..e1b4dbefc5 100644 --- a/src/rabbit_reader.erl +++ b/src/rabbit_reader.erl @@ -1130,7 +1130,7 @@ ic(channel_max, #connection{channel_max = ChMax}) -> ChMax; ic(client_properties, #connection{client_properties = CP}) -> CP; ic(auth_mechanism, #connection{auth_mechanism = none}) -> none; ic(auth_mechanism, #connection{auth_mechanism = {Name, _Mod}}) -> Name; -ic(connected_at, #connection{connected_at = Timestamp}) -> Timestamp; +ic(connected_at, #connection{connected_at = T}) -> timestamp_ms(T); ic(Item, #connection{}) -> throw({bad_argument, Item}). socket_info(Get, Select, #v1{sock = Sock}) -> @@ -1173,6 +1173,11 @@ emit_stats(State) -> _ -> State1 end. +timestamp_ms(unknown) -> + unknown; +timestamp_ms(Timestamp) -> + timer:now_diff(Timestamp, {0,0,0}) div 1000. + %% 1.0 stub -ifdef(use_specs). -spec(become_1_0/2 :: (non_neg_integer(), #v1{}) -> no_return()). |
