Fix the "index out of range" issue when sort metrics
This commit is contained in:
@@ -120,8 +120,10 @@ func (raw *Metrics) Sort(target, order, identifier string) *Metrics {
|
||||
// Record ordinals in the final result
|
||||
v, ok := mv.Metadata[identifier]
|
||||
if ok && v != "" {
|
||||
resourceOrdinal[v] = ordinal
|
||||
ordinal++
|
||||
if _, ok1 := resourceOrdinal[v]; !ok1 {
|
||||
resourceOrdinal[v] = ordinal
|
||||
ordinal++
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user