func makeQueryOverrideMap(pgVersion semver.Version, queryOverrides map[string][]OverrideQuery) map[string]string {
	resultMap := make(map[string]string)
	for name, overrideDef := range queryOverrides {
		// Find a matching semver. We make it an error to have overlapping
		// ranges at test-time, so only 1 should ever match.
		matched := false
		for _, queryDef := range overrideDef {
			if queryDef.versionRange(pgVersion) {
				resultMap[name] = queryDef.query
				matched = true
				break
			}
		}
		if !matched {
			log.Warnln("No query matched override for", name, "- disabling metric space.")
			resultMap[name] = ""
		}
	}

	return resultMap
}
// Convert the query override file to the version-specific query override file
// for the exporter.
Convert the query override file to the version-specific query override file
for the exporter.
// Convert the query override file to the version - specific query override file // for the exporter .
func makeQueryOverrideMap(pgVersion semver.Version, queryOverrides map[string][]OverrideQuery) map[string]string {
	resultMap := make(map[string]string)
	for name, overrideDef := range queryOverrides {
		matched := false
		for _, queryDef := range overrideDef {
			if queryDef.versionRange(pgVersion) {
				resultMap[name] = queryDef.query
				matched = true
				break
			}
		}
		if !matched {
			log.Warnln("No query matched override for", name, "- disabling metric space.")
			resultMap[name] = ""
		}
	}
	return resultMap
}
func makeQueryOverrideMap ( pgVersion semver . Version , queryOverrides map [ string ] [ ] OverrideQuery ) map [ string ] string { resultMap := make ( map [ string ] string ) for name , overrideDef := range queryOverrides { matched := false for _ , queryDef := range overrideDef { if queryDef . versionRange ( pgVersion ) { resultMap [ name ] = queryDef . query matched = true break } } if ! matched { log . Warnln ( " " , name , " " ) resultMap [ name ] = " " } } return resultMap }
Convert the query override file to the version-specific query override file
for the exporter.
Convert the query override file to the version - specific query override file for the exporter .
// Find a matching semver. We make it an error to have overlapping // ranges at test-time, so only 1 should ever match.