mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-02-18 00:41:46 +01:00
Add healthCheck support for external CCMS
This commit is contained in:
@@ -133,6 +133,12 @@ func (m *MemoryStore) GetHealthyMetrics(selector []string, expectedMetrics []str
|
||||
return degradedList, missingList, nil
|
||||
}
|
||||
|
||||
type HealthCheckReq struct {
|
||||
Cluster string `json:"cluster" example:"fritz"`
|
||||
Nodes []string `json:"nodes"`
|
||||
MetricNames []string `json:"metric-names"`
|
||||
}
|
||||
|
||||
// HealthCheck evaluates multiple nodes against a set of expected metrics
|
||||
// and returns a monitoring state per node.
|
||||
//
|
||||
|
||||
@@ -42,6 +42,13 @@ type InternalMetricStore struct{}
|
||||
|
||||
var MetricStoreHandle *InternalMetricStore
|
||||
|
||||
// HealthCheck delegates to the internal MemoryStore's HealthCheck.
|
||||
func (ccms *InternalMetricStore) HealthCheck(cluster string,
|
||||
nodes []string, metrics []string,
|
||||
) (map[string]HealthCheckResult, error) {
|
||||
return GetMemoryStore().HealthCheck(cluster, nodes, metrics)
|
||||
}
|
||||
|
||||
// TestLoadDataCallback allows tests to override LoadData behavior for testing purposes.
|
||||
// When set to a non-nil function, LoadData will call this function instead of the default implementation.
|
||||
var TestLoadDataCallback func(job *schema.Job, metrics []string, scopes []schema.MetricScope, ctx context.Context, resolution int) (schema.JobData, error)
|
||||
|
||||
Reference in New Issue
Block a user