mirror of
https://github.com/minio/minio.git
synced 2025-11-10 05:59:43 -05:00
enable go1.18.x builds (#14746)
This commit is contained in:
@@ -247,11 +247,11 @@ func (t *transitionState) addLastDayStats(tier string, ts tierStats) {
|
||||
t.lastDayStats[tier].addStats(ts)
|
||||
}
|
||||
|
||||
func (t *transitionState) getDailyAllTierStats() dailyAllTierStats {
|
||||
func (t *transitionState) getDailyAllTierStats() DailyAllTierStats {
|
||||
t.lastDayMu.RLock()
|
||||
defer t.lastDayMu.RUnlock()
|
||||
|
||||
res := make(dailyAllTierStats, len(t.lastDayStats))
|
||||
res := make(DailyAllTierStats, len(t.lastDayStats))
|
||||
for tier, st := range t.lastDayStats {
|
||||
res[tier] = st.clone()
|
||||
}
|
||||
|
||||
@@ -1719,9 +1719,9 @@ func (sys *NotificationSys) ReloadSiteReplicationConfig(ctx context.Context) []e
|
||||
}
|
||||
|
||||
// GetLastDayTierStats fetches per-tier stats of the last 24hrs from all peers
|
||||
func (sys *NotificationSys) GetLastDayTierStats(ctx context.Context) dailyAllTierStats {
|
||||
func (sys *NotificationSys) GetLastDayTierStats(ctx context.Context) DailyAllTierStats {
|
||||
errs := make([]error, len(sys.allPeerClients))
|
||||
lastDayStats := make([]dailyAllTierStats, len(sys.allPeerClients))
|
||||
lastDayStats := make([]DailyAllTierStats, len(sys.allPeerClients))
|
||||
var wg sync.WaitGroup
|
||||
for index := range sys.peerClients {
|
||||
if sys.peerClients[index] == nil {
|
||||
|
||||
@@ -1106,7 +1106,7 @@ func (client *peerRESTClient) ReloadSiteReplicationConfig(ctx context.Context) e
|
||||
return nil
|
||||
}
|
||||
|
||||
func (client *peerRESTClient) GetLastDayTierStats(ctx context.Context) (dailyAllTierStats, error) {
|
||||
func (client *peerRESTClient) GetLastDayTierStats(ctx context.Context) (DailyAllTierStats, error) {
|
||||
var result map[string]lastDayTierStats
|
||||
respBody, err := client.callWithContext(context.Background(), peerRESTMethodGetLastDayTierStats, nil, nil, -1)
|
||||
if err != nil {
|
||||
@@ -1116,9 +1116,9 @@ func (client *peerRESTClient) GetLastDayTierStats(ctx context.Context) (dailyAll
|
||||
|
||||
err = gob.NewDecoder(respBody).Decode(&result)
|
||||
if err != nil {
|
||||
return dailyAllTierStats{}, err
|
||||
return DailyAllTierStats{}, err
|
||||
}
|
||||
return dailyAllTierStats(result), nil
|
||||
return DailyAllTierStats(result), nil
|
||||
}
|
||||
|
||||
// DevNull - Used by netperf to pump data to peer
|
||||
|
||||
@@ -84,16 +84,16 @@ func (l lastDayTierStats) merge(m lastDayTierStats) (merged lastDayTierStats) {
|
||||
return merged
|
||||
}
|
||||
|
||||
// dailyAllTierStats is used to aggregate last day tier stats across MinIO servers
|
||||
type dailyAllTierStats map[string]lastDayTierStats
|
||||
// DailyAllTierStats is used to aggregate last day tier stats across MinIO servers
|
||||
type DailyAllTierStats map[string]lastDayTierStats
|
||||
|
||||
func (l dailyAllTierStats) merge(m dailyAllTierStats) {
|
||||
func (l DailyAllTierStats) merge(m DailyAllTierStats) {
|
||||
for tier, st := range m {
|
||||
l[tier] = l[tier].merge(st)
|
||||
}
|
||||
}
|
||||
|
||||
func (l dailyAllTierStats) addToTierInfo(tierInfos []madmin.TierInfo) []madmin.TierInfo {
|
||||
func (l DailyAllTierStats) addToTierInfo(tierInfos []madmin.TierInfo) []madmin.TierInfo {
|
||||
for i := range tierInfos {
|
||||
var lst lastDayTierStats
|
||||
var ok bool
|
||||
|
||||
Reference in New Issue
Block a user