Implement nodeMetrics query

This commit is contained in:
Lou Knauer
2021-12-09 16:25:48 +01:00
parent a26d652332
commit 8178b6e854
5 changed files with 532 additions and 0 deletions

View File

@@ -10,9 +10,17 @@ import (
)
type MetricDataRepository interface {
// Initialize this MetricDataRepository. One instance of
// this interface will only ever be responsible for one cluster.
Init(url string) error
// Return the JobData for the given job, only with the requested metrics.
LoadData(job *model.Job, metrics []string, ctx context.Context) (schema.JobData, error)
// Return a map of metrics to a map of nodes to the metric statistics of the job.
LoadStats(job *model.Job, metrics []string, ctx context.Context) (map[string]map[string]schema.MetricStatistics, error)
// Return a map of nodes to a map of metrics to the data for the requested time.
LoadNodeData(clusterId string, metrics, nodes []string, from, to int64, ctx context.Context) (map[string]map[string][]schema.Float, error)
}