Skip to content

Commit

Permalink
fix(checker): fix func ConvertForCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
kissken committed Jan 14, 2025
1 parent 3e5ad92 commit a2a266a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions checker/metrics/conversion/trigger_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,17 @@ func (triggerMetrics TriggerMetrics) FindMissingMetrics(declaredAloneMetrics set
// ConvertForCheck is a function that converts TriggerMetrics with structure
// map[TargetName]map[MetricName]MetricData to ConvertedTriggerMetrics
// with structure map[MetricName]map[TargetName]MetricData.
func (m TriggerMetrics) ConvertForCheck() map[string]map[string]metricSource.MetricData {
func (triggerMetrics TriggerMetrics) ConvertForCheck() map[string]map[string]metricSource.MetricData {
result := make(map[string]map[string]metricSource.MetricData)
for targetName, targetMetrics := range m {
for metricName := range targetMetrics {

for targetName, targetMetrics := range triggerMetrics {
for metricName, metricData := range targetMetrics {
if _, ok := result[metricName]; !ok {
result[metricName] = make(map[string]metricSource.MetricData, len(m))
result[metricName] = make(map[string]metricSource.MetricData, len(triggerMetrics))
}
result[metricName][targetName] = m[targetName][metricName]
result[metricName][targetName] = metricData
}
}

return result
}

0 comments on commit a2a266a

Please sign in to comment.