Skip to content

Commit

Permalink
Add observer to peer info
Browse files Browse the repository at this point in the history
This is to support nats-io/nats-server#4582.

Signed-off-by: Neil Twigg <neil@nats.io>
  • Loading branch information
neilalexander committed Sep 26, 2023
1 parent 30c85c3 commit 6fb84b8
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 5 deletions.
11 changes: 6 additions & 5 deletions api/cluster.go
Expand Up @@ -66,9 +66,10 @@ type ClusterInfo struct {
// PeerInfo shows information about all the peers in the cluster that
// are supporting the stream or consumer.
type PeerInfo struct {
Name string `json:"name" yaml:"name"`
Current bool `json:"current" yaml:"current"`
Offline bool `json:"offline,omitempty" yaml:"offline"`
Active time.Duration `json:"active" yaml:"active"`
Lag uint64 `json:"lag,omitempty" yaml:"lag"`
Name string `json:"name" yaml:"name"`
Current bool `json:"current" yaml:"current"`
Observer bool `json:"observer" yaml:"observer"`
Offline bool `json:"offline,omitempty" yaml:"offline"`
Active time.Duration `json:"active" yaml:"active"`
Lag uint64 `json:"lag,omitempty" yaml:"lag"`
}
5 changes: 5 additions & 0 deletions schema_source/jetstream/api/v1/definitions.json
Expand Up @@ -174,6 +174,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/advisory/v1/consumer_leader_elected.json
Expand Up @@ -57,6 +57,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/advisory/v1/consumer_quorum_lost.json
Expand Up @@ -52,6 +52,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/advisory/v1/stream_leader_elected.json
Expand Up @@ -52,6 +52,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/advisory/v1/stream_quorum_lost.json
Expand Up @@ -47,6 +47,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/api/v1/consumer_create_response.json
Expand Up @@ -443,6 +443,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/api/v1/consumer_info_response.json
Expand Up @@ -443,6 +443,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/api/v1/consumer_list_response.json
Expand Up @@ -508,6 +508,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/api/v1/stream_create_response.json
Expand Up @@ -617,6 +617,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/api/v1/stream_info_response.json
Expand Up @@ -617,6 +617,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/api/v1/stream_list_response.json
Expand Up @@ -682,6 +682,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/api/v1/stream_update_response.json
Expand Up @@ -617,6 +617,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down

0 comments on commit 6fb84b8

Please sign in to comment.