Print out restore time for streams to nearest millisecond.

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2023-09-03 13:28:18 -07:00
parent e11ddb8bfe
commit 4a5b76b0e8
2 changed files with 4 additions and 2 deletions

View File

@@ -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.

View File

@@ -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.