Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nsqd: update /info api to return more metadata #1403

Merged
merged 1 commit into from
May 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions nsqd/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,27 @@ func (s *httpServer) doInfo(w http.ResponseWriter, req *http.Request, ps httprou
return nil, http_api.Err{500, err.Error()}
}
return struct {
Version string `json:"version"`
BroadcastAddress string `json:"broadcast_address"`
Hostname string `json:"hostname"`
HTTPPort int `json:"http_port"`
TCPPort int `json:"tcp_port"`
StartTime int64 `json:"start_time"`
Version string `json:"version"`
BroadcastAddress string `json:"broadcast_address"`
Hostname string `json:"hostname"`
HTTPPort int `json:"http_port"`
TCPPort int `json:"tcp_port"`
StartTime int64 `json:"start_time"`
MaxHeartBeatInterval time.Duration `json:"max_heartbeat_interval"`
MaxOutBufferSize int64 `json:"max_output_buffer_size"`
MaxOutBufferTimeout time.Duration `json:"max_output_buffer_timeout"`
MaxDeflateLevel int `json:"max_deflate_level"`
}{
Version: version.Binary,
BroadcastAddress: s.nsqd.getOpts().BroadcastAddress,
Hostname: hostname,
TCPPort: s.nsqd.RealTCPAddr().Port,
HTTPPort: s.nsqd.RealHTTPAddr().Port,
StartTime: s.nsqd.GetStartTime().Unix(),
Version: version.Binary,
BroadcastAddress: s.nsqd.getOpts().BroadcastAddress,
Hostname: hostname,
TCPPort: s.nsqd.RealTCPAddr().Port,
HTTPPort: s.nsqd.RealHTTPAddr().Port,
StartTime: s.nsqd.GetStartTime().Unix(),
MaxHeartBeatInterval: s.nsqd.getOpts().MaxHeartbeatInterval,
MaxOutBufferSize: s.nsqd.getOpts().MaxOutputBufferSize,
MaxOutBufferTimeout: s.nsqd.getOpts().MaxOutputBufferTimeout,
MaxDeflateLevel: s.nsqd.getOpts().MaxDeflateLevel,
}, nil
}

Expand Down