mirror of
https://github.com/minio/minio.git
synced 2025-11-10 14:09:48 -05:00
Add timeinfo to health data (#14013)
Capture RoundtripDuration to figure out NTP issues in subnet health analyzer.
This commit is contained in:
@@ -49,6 +49,7 @@ import (
|
||||
"github.com/minio/console/restapi"
|
||||
"github.com/minio/console/restapi/operations"
|
||||
"github.com/minio/kes"
|
||||
"github.com/minio/madmin-go"
|
||||
"github.com/minio/minio-go/v7"
|
||||
"github.com/minio/minio-go/v7/pkg/credentials"
|
||||
"github.com/minio/minio-go/v7/pkg/set"
|
||||
@@ -132,6 +133,8 @@ func init() {
|
||||
console.SetColor("Debug", fcolor.New())
|
||||
|
||||
gob.Register(StorageErr(""))
|
||||
gob.Register(madmin.TimeInfo{})
|
||||
gob.Register(map[string]interface{}{})
|
||||
|
||||
defaultAWSCredProvider = []credentials.Provider{
|
||||
&credentials.IAM{
|
||||
|
||||
@@ -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