mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 06:34:18 +02:00
streamline table api (#101)
This commit is contained in:
@@ -58,8 +58,8 @@ func ClusterList(conf *cfg.Config) error {
|
||||
|
||||
wg.Wait()
|
||||
|
||||
table := printer.NewTable(conf, 5, len(conf.Clusters))
|
||||
table.Addheaders("cluster", "uri", "reachable", "current", "error")
|
||||
table := printer.NewTable(conf).WithSize(5, len(conf.Clusters)).
|
||||
WithHeaders("cluster", "uri", "reachable", "current", "error")
|
||||
|
||||
idx := 0
|
||||
|
||||
@@ -212,8 +212,8 @@ func ClusterStatus(conf *cfg.Config) error {
|
||||
}
|
||||
}
|
||||
|
||||
table := printer.NewTable(conf, 2, 7)
|
||||
table.Addheaders(conf.DefaultCluster.Name, "status")
|
||||
table := printer.NewTable(conf).WithSize(2, 7).
|
||||
WithHeaders(conf.DefaultCluster.Name, "status")
|
||||
|
||||
table.Entries = [][]any{
|
||||
{"Cluster Name", res.health.ClusterName},
|
||||
@@ -291,7 +291,7 @@ func gatherClusterStats(clusterstats *clusterstats.Response, table *printer.Tabl
|
||||
{"indices", clusterstats.Indices.Count},
|
||||
{"Docs", clusterstats.Indices.Docs.Count},
|
||||
{"Total Size", printer.Bytes(clusterstats.Indices.Docs.TotalSizeInBytes)},
|
||||
{"Total Queries", "%d", querycount},
|
||||
{"Total Queries", querycount},
|
||||
{"Shards Primaries", clusterstats.Indices.Shards.Primaries},
|
||||
{"Shards Total", clusterstats.Indices.Shards.Total},
|
||||
{"Storage", fmt.Sprintf(
|
||||
|
||||
Reference in New Issue
Block a user