[ADDED] New fields in ClusterInfo (#1935)

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
This commit is contained in:
Piotr Piotrowski
2025-09-18 13:03:39 +02:00
committed by Piotr Piotrowski
parent 460f3ded59
commit 3416ed073b
2 changed files with 23 additions and 4 deletions

View File

@@ -279,10 +279,25 @@ type (
// Name is the name of the cluster. // Name is the name of the cluster.
Name string `json:"name,omitempty"` Name string `json:"name,omitempty"`
// RaftGroup is the name of the Raft group managing the asset (in
// clustered environments).
RaftGroup string `json:"raft_group,omitempty"`
// Leader is the server name of the RAFT leader. // Leader is the server name of the RAFT leader.
Leader string `json:"leader,omitempty"` Leader string `json:"leader,omitempty"`
// Replicas is the list of members of the RAFT cluster // LeaderSince is the time that it was elected as leader in RFC3339
// format, absent when not the leader.
LeaderSince *time.Time `json:"leader_since,omitempty"`
// SystemAcc indicates if the traffic_account is the system account.
// When true, replication traffic goes over the system account.
SystemAcc bool `json:"system_account,omitempty"`
// TrafficAcc is the account where the replication traffic goes over.
TrafficAcc string `json:"traffic_account,omitempty"`
// Replicas is the list of members of the RAFT cluster.
Replicas []*PeerInfo `json:"replicas,omitempty"` Replicas []*PeerInfo `json:"replicas,omitempty"`
} }

10
jsm.go
View File

@@ -1093,9 +1093,13 @@ type StreamState struct {
// ClusterInfo shows information about the underlying set of servers // ClusterInfo shows information about the underlying set of servers
// that make up the stream or consumer. // that make up the stream or consumer.
type ClusterInfo struct { type ClusterInfo struct {
Name string `json:"name,omitempty"` Name string `json:"name,omitempty"`
Leader string `json:"leader,omitempty"` RaftGroup string `json:"raft_group,omitempty"`
Replicas []*PeerInfo `json:"replicas,omitempty"` Leader string `json:"leader,omitempty"`
LeaderSince *time.Time `json:"leader_since,omitempty"`
SystemAcc bool `json:"system_account,omitempty"`
TrafficAcc string `json:"traffic_account,omitempty"`
Replicas []*PeerInfo `json:"replicas,omitempty"`
} }
// PeerInfo shows information about all the peers in the cluster that // PeerInfo shows information about all the peers in the cluster that