diff --git a/pkg/es/cluster.go b/pkg/es/cluster.go index f4d8e9c..ac8904b 100644 --- a/pkg/es/cluster.go +++ b/pkg/es/cluster.go @@ -256,8 +256,8 @@ func gatherClusterStats(conf *cfg.Config, clusterstats *clusterstats.Response, t } table.Entries = append(table.Entries, [][]any{ - {"Indicies", fmt.Sprintf("%d", clusterstats.Indices.Count)}, - {"Docs", fmt.Sprintf("%d", clusterstats.Indices.Docs.Count)}, + {"Indicies", clusterstats.Indices.Count}, + {"Docs", clusterstats.Indices.Docs.Count}, {"Total Size", printer.Bytes(clusterstats.Indices.Docs.TotalSizeInBytes)}, {"Total Queries", "%d", querycount}, {"Shards Primaries", clusterstats.Indices.Shards.Primaries}, diff --git a/pkg/es/cluster_util.go b/pkg/es/cluster_util.go index 8cc0ec7..e72115e 100644 --- a/pkg/es/cluster_util.go +++ b/pkg/es/cluster_util.go @@ -79,20 +79,20 @@ func checkClusterStatus(conf *cfg.Config, leader, follower string) bool { printer.Colorize(conf, status[follower].Status.Name, status[follower].Status.Name), }, {"Active Shards", - fmt.Sprintf("%d", status[leader].ActiveShards), - fmt.Sprintf("%d", status[follower].ActiveShards), + status[leader].ActiveShards, + status[follower].ActiveShards, }, {"Active Primary Shards", - fmt.Sprintf("%d", status[leader].ActivePrimaryShards), - fmt.Sprintf("%d", status[follower].ActivePrimaryShards), + status[leader].ActivePrimaryShards, + status[follower].ActivePrimaryShards, }, {"Indicies", - fmt.Sprintf("%d", len(status[leader].Indices)), - fmt.Sprintf("%d", len(status[follower].Indices)), + len(status[leader].Indices), + len(status[follower].Indices), }, {"Nodes", - fmt.Sprintf("%d", status[leader].NumberOfNodes), - fmt.Sprintf("%d", status[follower].NumberOfNodes), + status[leader].NumberOfNodes, + status[follower].NumberOfNodes, }, } @@ -112,7 +112,7 @@ func checkClusterStatus(conf *cfg.Config, leader, follower string) bool { // finds indices on both clusters which have ilm errors func findIlmErrors(conf *cfg.Config, leader, follower string) bool { - failed := map[string]map[string]string{} + failed := map[string]map[string]any{} for _, cluster := range []string{leader, follower} { ilm, err := conf.Clusters[cluster].ES().Ilm.ExplainLifecycle("_all"). @@ -123,13 +123,13 @@ func findIlmErrors(conf *cfg.Config, leader, follower string) bool { return false } - failed[cluster] = map[string]string{} + failed[cluster] = map[string]any{} for name, ilmstate := range ilm.Indices { count := ilmstate.(*types.LifecycleExplainManaged).FailedStepRetryCount if count != nil && *count > 0 { - failed[cluster][name] = fmt.Sprintf("%d", *count) + failed[cluster][name] = *count } } }