mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Print out restore time for streams to nearest millisecond.
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -1311,6 +1311,7 @@ func (a *Account) EnableJetStream(limits map[string]JetStreamAccountLimits) erro
|
||||
}
|
||||
|
||||
s.Noticef(" Starting restore for stream '%s > %s'", a.Name, cfg.StreamConfig.Name)
|
||||
rt := time.Now()
|
||||
|
||||
// Log if we are converting from plaintext to encrypted.
|
||||
if encrypted {
|
||||
@@ -1341,7 +1342,8 @@ func (a *Account) EnableJetStream(limits map[string]JetStreamAccountLimits) erro
|
||||
}
|
||||
|
||||
state := mset.state()
|
||||
s.Noticef(" Restored %s messages for stream '%s > %s'", comma(int64(state.Msgs)), mset.accName(), mset.name())
|
||||
s.Noticef(" Restored %s messages for stream '%s > %s' in %v",
|
||||
comma(int64(state.Msgs)), mset.accName(), mset.name(), time.Since(rt).Round(time.Millisecond))
|
||||
|
||||
// Collect to check for dangling messages.
|
||||
// TODO(dlc) - Can be removed eventually.
|
||||
|
||||
@@ -3468,7 +3468,7 @@ func (s *Server) processStreamRestore(ci *ClientInfo, acc *Account, cfg *StreamC
|
||||
TimeStamp: time.Now().UTC(),
|
||||
}
|
||||
s.Noticef("Completed restore of %s for stream '%s > %s' in %v",
|
||||
friendlyBytes(int64(total)), streamName, acc.Name, end.Sub(start))
|
||||
friendlyBytes(int64(total)), streamName, acc.Name, end.Sub(start).Round(time.Millisecond))
|
||||
}
|
||||
|
||||
// On the last EOF, send back the stream info or error status.
|
||||
|
||||
Reference in New Issue
Block a user