mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 06:34:18 +02:00
add ilm forecast data collection, generalized parallel api calls
This commit is contained in:
@@ -35,28 +35,8 @@ import (
|
||||
"github.com/elastic/go-elasticsearch/v9/typedapi/types"
|
||||
)
|
||||
|
||||
const (
|
||||
ResponseHealth = iota
|
||||
ResponseInfo
|
||||
ResponseCcr
|
||||
ResponseStats
|
||||
ResponseIndices
|
||||
ResponseTasks
|
||||
)
|
||||
|
||||
type ClusterIndices map[string]map[string]*types.IndicesRecord
|
||||
|
||||
type apiResponse struct {
|
||||
error error
|
||||
info *info.Response
|
||||
health *health.Response
|
||||
ccr *stats.Response
|
||||
stats *clusterstats.Response
|
||||
indices *indices.Response
|
||||
tasks *tasks.Response
|
||||
which int
|
||||
}
|
||||
|
||||
func ClusterList(conf *cfg.Config) error {
|
||||
table := printer.NewTable(conf, 4, len(conf.Clusters))
|
||||
|
||||
@@ -123,14 +103,14 @@ func ClusterStatus(conf *cfg.Config) error {
|
||||
wg := &sync.WaitGroup{}
|
||||
|
||||
wg.Add(gocount)
|
||||
go getClusterData(es, wg, responses, "health")
|
||||
go getClusterData(es, wg, responses, "info")
|
||||
go getClusterData(es, wg, responses, "ccrstats")
|
||||
go getClusterData(es, wg, responses, "indices")
|
||||
go getClusterData(es, wg, responses, "tasks")
|
||||
go getApiData(es, wg, responses, "health")
|
||||
go getApiData(es, wg, responses, "info")
|
||||
go getApiData(es, wg, responses, "ccrstats")
|
||||
go getApiData(es, wg, responses, "indices")
|
||||
go getApiData(es, wg, responses, "tasks")
|
||||
|
||||
if conf.Verbose {
|
||||
go getClusterData(es, wg, responses, "stats")
|
||||
go getApiData(es, wg, responses, "stats")
|
||||
}
|
||||
|
||||
wg.Wait()
|
||||
|
||||
Reference in New Issue
Block a user