add ilm forecast data collection, generalized parallel api calls

This commit is contained in:
2026-06-25 11:54:06 +02:00
parent 825b3ce5d1
commit 5f60696b01
7 changed files with 585 additions and 152 deletions

View File

@@ -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()