Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
We'll need this for the upcoming change to add an upper bound on drai…
Browse files Browse the repository at this point in the history
…n lifetime.

Since we're doing a cluster replacement anyway for closing idle
drains, we might as well get this record change in while we're at it
so the next upgrade can be a live one.
  • Loading branch information
technomancy committed Jan 13, 2014
1 parent 7415617 commit 1583420
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/logplex_http_drain.erl
Expand Up @@ -45,7 +45,9 @@
drop_info :: drop_info() | 'undefined',
%% Last time we connected or successfully sent data
last_good_time :: 'undefined' | erlang:timestamp(),
service = normal :: 'normal' | 'degraded'
service = normal :: 'normal' | 'degraded',
%% Time of last successful connection
connect_time :: 'undefined' | erlang:timestamp()
}).

-record(frame, {frame :: iolist(),
Expand Down Expand Up @@ -265,7 +267,8 @@ try_connect(State = #state{uri=Uri,
log_info(State, [ltcy(ConnectStart, ConnectEnd)])),
maybe_resize(Status, Buf),
NewTimerState = start_idle_timer(State),
ready_to_send(NewTimerState#state{client=Pid, service=normal});
ready_to_send(NewTimerState#state{client=Pid, service=normal,
connect_time=os:timestamp()});
Why ->
ConnectEnd = os:timestamp(),
?WARN("drain_id=~p channel_id=~p dest=~s at=try_connect "
Expand Down
3 changes: 2 additions & 1 deletion test/logplex_http_drain_SUITE.erl
Expand Up @@ -22,7 +22,8 @@ groups() -> [{overflow, [], [full_buffer_success, full_buffer_fail,
drop_info,
%% Last time we connected or successfully sent data
last_good_time :: 'undefined' | erlang:timestamp(),
service = normal :: 'normal' | 'degraded'
service = normal :: 'normal' | 'degraded',
connect_time :: 'undefined' | erlang:timestamp()
}).

init_per_suite(Config) ->
Expand Down

0 comments on commit 1583420

Please sign in to comment.