mirror of
https://github.com/pgsty/minio.git
synced 2026-07-22 13:40:22 +03:00
Add timeinfo to health data (#14013)
Capture RoundtripDuration to figure out NTP issues in subnet health analyzer.
This commit is contained in:
@@ -422,12 +422,21 @@ func (client *peerRESTClient) GetSELinuxInfo(ctx context.Context) (info madmin.S
|
||||
|
||||
// GetSysConfig - fetch sys config for a remote node.
|
||||
func (client *peerRESTClient) GetSysConfig(ctx context.Context) (info madmin.SysConfig, err error) {
|
||||
sent := time.Now()
|
||||
respBody, err := client.callWithContext(ctx, peerRESTMethodSysConfig, nil, nil, -1)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
roundtrip := int32(time.Since(sent).Milliseconds())
|
||||
defer http.DrainBody(respBody)
|
||||
|
||||
err = gob.NewDecoder(respBody).Decode(&info)
|
||||
cfg := info.Config["time-info"]
|
||||
if cfg != nil {
|
||||
ti := cfg.(madmin.TimeInfo)
|
||||
ti.RoundtripDuration = roundtrip
|
||||
info.Config["time-info"] = ti
|
||||
}
|
||||
return info, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user