Skip to content

Commit

Permalink
Log stream total lifetime
Browse files Browse the repository at this point in the history
This commit simply logs the duration of the total lifetime of a stream

Change-Id: Id392610aaf4ab4ec81c549ea87c6bf1b240be39f
Signed-off-by: Yacov Manevich <yacovm@il.ibm.com>
(cherry picked from commit db0a864)
  • Loading branch information
yacovm authored and denyeart committed Feb 18, 2021
1 parent 8543389 commit 1524fc9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion orderer/common/cluster/comm.go
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,13 @@ func (stream *Stream) sendMessage(request *orderer.StepRequest) {
}

func (stream *Stream) serviceStream() {
defer stream.Cancel(errAborted)
streamStartTime := time.Now()
defer func() {
stream.Logger.Debugf("Stream %d to (%s) terminating at total lifetime of %s",
stream.ID, stream.Endpoint, time.Since(streamStartTime))

stream.Cancel(errAborted)
}()

for {
select {
Expand Down

0 comments on commit 1524fc9

Please sign in to comment.