remove unneccessary fmt.Sprintf's

This commit is contained in:
2026-07-07 06:43:34 +02:00
parent 86f17329b0
commit 3abe8b62a2
2 changed files with 13 additions and 13 deletions

View File

@@ -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},

View File

@@ -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
}
}
}