Skip to content

Commit beee2b3

Browse files
committed
Usage metrics flags sorted in alphabetic order
1 parent 7d552db commit beee2b3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

utils/usage/visibility/commands_count_metric.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package visibility
22

33
import (
44
"os"
5+
"sort"
56
"strings"
67

78
"github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
@@ -76,7 +77,11 @@ func NewCommandsCountMetricWithEnhancedData(commandName string, metricsData *Met
7677
}
7778

7879
if metricsData != nil {
79-
labels.Flags = strings.Join(metricsData.FlagsUsed, ",")
80+
if len(metricsData.FlagsUsed) > 0 {
81+
flags := append([]string(nil), metricsData.FlagsUsed...)
82+
sort.Strings(flags)
83+
labels.Flags = strings.Join(flags, ",")
84+
}
8085
labels.Platform = metricsData.OS
8186
labels.Architecture = metricsData.Architecture
8287
if metricsData.IsCI {

0 commit comments

Comments
 (0)