diff --git a/disperser/dataapi/metrics_handlers.go b/disperser/dataapi/metrics_handlers.go index 6d76d7e9b..90692cb7a 100644 --- a/disperser/dataapi/metrics_handlers.go +++ b/disperser/dataapi/metrics_handlers.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "math/big" + "sort" "strconv" "time" @@ -186,6 +187,14 @@ func (s *server) getOperatorNonsigningPercentage(ctx context.Context, intervalSe } } + // Sort by descending order of nonsigning rate. + sort.Slice(operators, func(i, j int) bool { + if operators[i].Percentage == operators[j].Percentage { + return operators[i].OperatorId < operators[j].OperatorId + } + return operators[i].Percentage > operators[j].Percentage + }) + return &OperatorsNonsigningPercentage{ Meta: Meta{ Size: len(operators),