Documentation ¶
Overview ¶
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Copyright (C) 2022 DKRZ All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Index ¶
- Variables
- func DeepCopy(jd_temp schema.JobData) schema.JobData
- func Init() error
- func MinMaxMean(data []schema.Float) (float64, float64, float64)
- type ApiMetricData
- type ApiQuery
- type ApiQueryRequest
- type ApiQueryResponse
- type CCMetricStore
- func (ccms *CCMetricStore) Init(rawConfig json.RawMessage) error
- func (ccms *CCMetricStore) LoadData(job *schema.Job, metrics []string, scopes []schema.MetricScope, ...) (schema.JobData, error)
- func (ccms *CCMetricStore) LoadNodeData(cluster string, metrics, nodes []string, scopes []schema.MetricScope, ...) (map[string]map[string][]*schema.JobMetric, error)
- func (ccms *CCMetricStore) LoadStats(job *schema.Job, metrics []string, ctx context.Context) (map[string]map[string]schema.MetricStatistics, error)
- type CCMetricStoreConfig
- type InfluxDBv2DataRepository
- func (idb *InfluxDBv2DataRepository) Init(rawConfig json.RawMessage) error
- func (idb *InfluxDBv2DataRepository) LoadData(job *schema.Job, metrics []string, scopes []schema.MetricScope, ...) (schema.JobData, error)
- func (idb *InfluxDBv2DataRepository) LoadNodeData(cluster string, metrics, nodes []string, scopes []schema.MetricScope, ...) (map[string]map[string][]*schema.JobMetric, error)
- func (idb *InfluxDBv2DataRepository) LoadStats(job *schema.Job, metrics []string, ctx context.Context) (map[string]map[string]schema.MetricStatistics, error)
- type InfluxDBv2DataRepositoryConfig
- type MetricDataRepository
- type PromQLArgs
- type PrometheusDataRepository
- func (pdb *PrometheusDataRepository) FormatQuery(metric string, scope schema.MetricScope, nodes []string, cluster string) (string, error)
- func (pdb *PrometheusDataRepository) Init(rawConfig json.RawMessage) error
- func (pdb *PrometheusDataRepository) LoadData(job *schema.Job, metrics []string, scopes []schema.MetricScope, ...) (schema.JobData, error)
- func (pdb *PrometheusDataRepository) LoadNodeData(cluster string, metrics, nodes []string, scopes []schema.MetricScope, ...) (map[string]map[string][]*schema.JobMetric, error)
- func (pdb *PrometheusDataRepository) LoadStats(job *schema.Job, metrics []string, ctx context.Context) (map[string]map[string]schema.MetricStatistics, error)
- func (pdb *PrometheusDataRepository) RowToSeries(from time.Time, step int64, steps int64, row *promm.SampleStream) schema.Series
- type PrometheusDataRepositoryConfig
- type TestMetricDataRepository
- func (tmdr *TestMetricDataRepository) Init(_ json.RawMessage) error
- func (tmdr *TestMetricDataRepository) LoadData(job *schema.Job, metrics []string, scopes []schema.MetricScope, ...) (schema.JobData, error)
- func (tmdr *TestMetricDataRepository) LoadNodeData(cluster string, metrics, nodes []string, scopes []schema.MetricScope, ...) (map[string]map[string][]*schema.JobMetric, error)
- func (tmdr *TestMetricDataRepository) LoadStats(job *schema.Job, metrics []string, ctx context.Context) (map[string]map[string]schema.MetricStatistics, error)
- type Trie
Constants ¶
This section is empty.
Variables ¶
var TestLoadDataCallback func(job *schema.Job, metrics []string, scopes []schema.MetricScope, ctx context.Context, resolution int) (schema.JobData, error) = func(job *schema.Job, metrics []string, scopes []schema.MetricScope, ctx context.Context, resolution int) (schema.JobData, error) { panic("TODO") }
Functions ¶
Types ¶
type ApiMetricData ¶
type ApiQuery ¶
type ApiQuery struct { Type *string `json:"type,omitempty"` SubType *string `json:"subtype,omitempty"` Metric string `json:"metric"` Hostname string `json:"host"` Resolution int `json:"resolution"` TypeIds []string `json:"type-ids,omitempty"` SubTypeIds []string `json:"subtype-ids,omitempty"` Aggregate bool `json:"aggreg"` }
type ApiQueryRequest ¶
type ApiQueryResponse ¶
type ApiQueryResponse struct { Queries []ApiQuery `json:"queries,omitempty"` Results [][]ApiMetricData `json:"results"` }
type CCMetricStore ¶
type CCMetricStore struct {
// contains filtered or unexported fields
}
func (*CCMetricStore) Init ¶
func (ccms *CCMetricStore) Init(rawConfig json.RawMessage) error
func (*CCMetricStore) LoadNodeData ¶
func (ccms *CCMetricStore) LoadNodeData( cluster string, metrics, nodes []string, scopes []schema.MetricScope, from, to time.Time, ctx context.Context, ) (map[string]map[string][]*schema.JobMetric, error)
TODO: Support sub-node-scope metrics! For this, the partition of a node needs to be known!
type CCMetricStoreConfig ¶
type CCMetricStoreConfig struct { Kind string `json:"kind"` Url string `json:"url"` Token string `json:"token"` // If metrics are known to this MetricDataRepository under a different // name than in the `metricConfig` section of the 'cluster.json', // provide this optional mapping of local to remote name for this metric. Renamings map[string]string `json:"metricRenamings"` }
type InfluxDBv2DataRepository ¶
type InfluxDBv2DataRepository struct {
// contains filtered or unexported fields
}
func (*InfluxDBv2DataRepository) Init ¶
func (idb *InfluxDBv2DataRepository) Init(rawConfig json.RawMessage) error
func (*InfluxDBv2DataRepository) LoadNodeData ¶
type MetricDataRepository ¶
type MetricDataRepository interface { // Initialize this MetricDataRepository. One instance of // this interface will only ever be responsible for one cluster. Init(rawConfig json.RawMessage) error // Return the JobData for the given job, only with the requested metrics. LoadData(job *schema.Job, metrics []string, scopes []schema.MetricScope, ctx context.Context, resolution int) (schema.JobData, error) // Return a map of metrics to a map of nodes to the metric statistics of the job. node scope assumed for now. LoadStats(job *schema.Job, metrics []string, ctx context.Context) (map[string]map[string]schema.MetricStatistics, error) // Return a map of hosts to a map of metrics at the requested scopes for that node. LoadNodeData(cluster string, metrics, nodes []string, scopes []schema.MetricScope, from, to time.Time, ctx context.Context) (map[string]map[string][]*schema.JobMetric, error) }
func GetMetricDataRepo ¶ added in v1.4.0
func GetMetricDataRepo(cluster string) (MetricDataRepository, error)
type PromQLArgs ¶
type PromQLArgs struct {
Nodes string
}
type PrometheusDataRepository ¶
type PrometheusDataRepository struct {
// contains filtered or unexported fields
}
func (*PrometheusDataRepository) FormatQuery ¶
func (pdb *PrometheusDataRepository) FormatQuery( metric string, scope schema.MetricScope, nodes []string, cluster string, ) (string, error)
TODO: respect scope argument
func (*PrometheusDataRepository) Init ¶
func (pdb *PrometheusDataRepository) Init(rawConfig json.RawMessage) error
func (*PrometheusDataRepository) LoadNodeData ¶
func (*PrometheusDataRepository) LoadStats ¶
func (pdb *PrometheusDataRepository) LoadStats( job *schema.Job, metrics []string, ctx context.Context, ) (map[string]map[string]schema.MetricStatistics, error)
TODO change implementation to precomputed/cached stats
func (*PrometheusDataRepository) RowToSeries ¶
func (pdb *PrometheusDataRepository) RowToSeries( from time.Time, step int64, steps int64, row *promm.SampleStream, ) schema.Series
Convert PromAPI row to CC schema.Series
type TestMetricDataRepository ¶
type TestMetricDataRepository struct{}
Only a mock for unit-testing.
func (*TestMetricDataRepository) Init ¶
func (tmdr *TestMetricDataRepository) Init(_ json.RawMessage) error