Fix merge errors

This commit is contained in:
Jan Eitzinger
2023-04-11 16:26:09 +02:00
parent f8ba79e9e7
commit 129dd13fc8
6 changed files with 5 additions and 42 deletions

View File

@@ -194,10 +194,6 @@ func (r *queryResolver) JobMetrics(ctx context.Context, id string, metrics []str
res := []*model.JobMetricWithName{}
for name, md := range data {
for scope, metric := range md {
if metric.Scope != schema.MetricScope(scope) {
log.Panic("metric.Scope != schema.MetricScope(scope) : Should not happen!")
}
res = append(res, &model.JobMetricWithName{
Name: name,
Scope: scope,

View File

@@ -211,15 +211,10 @@ func (idb *InfluxDBv2DataRepository) LoadData(
for _, scope := range scopes {
if scope == "node" { // No 'socket/core' support yet
for metric, nodes := range stats {
// log.Debugf("<< Add Stats for : Field %s >>", metric)
for node, stats := range nodes {
// log.Debugf("<< Add Stats for : Host %s : Min %.2f, Max %.2f, Avg %.2f >>", node, stats.Min, stats.Max, stats.Avg )
for index, _ := range jobData[metric][scope].Series {
// log.Debugf("<< Try to add Stats to Series in Position %d >>", index)
if jobData[metric][scope].Series[index].Hostname == node {
// log.Debugf("<< Match for Series in Position %d : Host %s >>", index, jobData[metric][scope].Series[index].Hostname)
jobData[metric][scope].Series[index].Statistics = &schema.MetricStatistics{Avg: stats.Avg, Min: stats.Min, Max: stats.Max}
// log.Debugf("<< Result Inner: Min %.2f, Max %.2f, Avg %.2f >>", jobData[metric][scope].Series[index].Statistics.Min, jobData[metric][scope].Series[index].Statistics.Max, jobData[metric][scope].Series[index].Statistics.Avg)
jobData[metric][scope].Series[index].Statistics = schema.MetricStatistics{Avg: stats.Avg, Min: stats.Min, Max: stats.Max}
}
}
}
@@ -227,17 +222,6 @@ func (idb *InfluxDBv2DataRepository) LoadData(
}
}
// DEBUG:
// for _, scope := range scopes {
// for _, met := range metrics {
// for _, series := range jobData[met][scope].Series {
// log.Debugf("<< Result: %d data points for metric %s on %s with scope %s, Stats: Min %.2f, Max %.2f, Avg %.2f >>",
// len(series.Data), met, series.Hostname, scope,
// series.Statistics.Min, series.Statistics.Max, series.Statistics.Avg)
// }
// }
// }
return jobData, nil
}

View File

@@ -251,7 +251,7 @@ func (pdb *PrometheusDataRepository) RowToSeries(
return schema.Series{
Hostname: hostname,
Data: values,
Statistics: &schema.MetricStatistics{
Statistics: schema.MetricStatistics{
Avg: mean,
Min: min,
Max: max,
@@ -323,7 +323,6 @@ func (pdb *PrometheusDataRepository) LoadData(
if !ok {
jobMetric = &schema.JobMetric{
Unit: metricConfig.Unit,
Scope: scope,
Timestep: metricConfig.Timestep,
Series: make([]schema.Series, 0),
}
@@ -362,7 +361,7 @@ func (pdb *PrometheusDataRepository) LoadStats(
for metric, metricData := range data {
stats[metric] = make(map[string]schema.MetricStatistics)
for _, series := range metricData[schema.MetricScopeNode].Series {
stats[metric][series.Hostname] = *series.Statistics
stats[metric][series.Hostname] = series.Statistics
}
}
@@ -432,7 +431,6 @@ func (pdb *PrometheusDataRepository) LoadNodeData(
// output per host and metric
hostdata[metric] = append(hostdata[metric], &schema.JobMetric{
Unit: metricConfig.Unit,
Scope: scope,
Timestep: metricConfig.Timestep,
Series: []schema.Series{pdb.RowToSeries(from, step, steps, row)},
},