mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Record the stream and consumer info timestamps
This records the server time when info for streams and consumers are created so that tools such as the nats cli can calculate time deltas for last ack, last delivered and so forth in the context of the server clock. This will help aleviate problems with client devices experiencing clock jitter that can show up in user interfaces as negative seconds since last ack etc Signed-off-by: R.I.Pienaar <rip@devco.net>
This commit is contained in:
@@ -55,6 +55,8 @@ type ConsumerInfo struct {
|
||||
NumPending uint64 `json:"num_pending"`
|
||||
Cluster *ClusterInfo `json:"cluster,omitempty"`
|
||||
PushBound bool `json:"push_bound,omitempty"`
|
||||
// TimeStamp indicates when the info was gathered
|
||||
TimeStamp time.Time `json:"ts"`
|
||||
}
|
||||
|
||||
type ConsumerConfig struct {
|
||||
@@ -2394,6 +2396,7 @@ func (o *consumer) infoWithSnapAndReply(snap bool, reply string) *ConsumerInfo {
|
||||
NumRedelivered: len(o.rdc),
|
||||
NumPending: o.checkNumPending(),
|
||||
PushBound: o.isPushMode() && o.active,
|
||||
TimeStamp: time.Now().UTC(),
|
||||
}
|
||||
|
||||
// If we are replicated and we are not the leader we need to pull certain data from our store.
|
||||
|
||||
Reference in New Issue
Block a user