// Code generated by monitor-code-gen. DO NOT EDIT. package {{.goPackage}} import ( {{if .metrics}} "github.com/signalfx/golib/datapoint" {{- end}} "github.com/signalfx/signalfx-agent/internal/monitors" ) {{if (len .monitors) eq 1 }} const {{"monitorType" | formatVariable}} = "{{(index .monitors 0).MonitorType}}" {{end}} {{with .groupMetricsMap}} const ( {{- range $group, $metrics := . }} {{(printf "group.%s" $group) | formatVariable}} = "{{$group}}" {{- end}} ) {{end}} var {{"groupSet" | formatVariable}} = map[string]bool { {{- range $group, $metrics := .groupMetricsMap}} {{(printf "group.%s" $group) | formatVariable}}: true, {{- end}} } {{with .metrics}} const ( {{- range $metric, $info := .}} {{$metric | formatVariable}} = "{{$metric}}" {{- with $info.Alias}} {{. | formatVariable}} = "{{.}}" {{- end}} {{- end}} ) {{end}} var {{"metricSet" | formatVariable}} = map[string]monitors.MetricInfo { {{- range $metric, $info := .metrics}} {{- if $info.Group}} {{$metric | formatVariable}}: {Type: {{$info.Type | convertMetricType}}, Group: {{$info.Group | deref | printf "group.%s" | formatVariable}}}, {{- else}} {{$metric | formatVariable}}: {Type: {{$info.Type | convertMetricType}}}, {{- end}} {{- end}} } var {{"defaultMetrics" | formatVariable}} = map[string]bool { {{- range $metric, $info := .metrics}} {{- if $info.Default}} {{$metric | formatVariable}}: true, {{- with $info.Alias}} {{. | formatVariable}}: true, {{- end}} {{- end}} {{- end}} } var {{"groupMetricsMap" | formatVariable}} = map[string][]string { {{- range $group, $metrics := .groupMetricsMap}} {{(printf "group.%s" $group) | formatVariable}}: []string { {{- range $metrics}} {{. | formatVariable}}, {{- end}} }, {{- end}} } {{range .monitors}} var {{if gt (len $.monitors) 1 -}} {{- (printf "%s.%s" .MonitorType "monitorMetadata") | formatVariable -}} {{else -}} {{"monitorMetadata" | formatVariable}}{{end}} = monitors.Metadata{ MonitorType: "{{.MonitorType}}", DefaultMetrics: {{"defaultMetrics" | formatVariable}}, Metrics: {{"metricSet" | formatVariable}}, MetricsExhaustive: {{.MetricsExhaustive}}, Groups: {{"groupSet" | formatVariable}}, GroupMetricsMap: {{"groupMetricsMap" | formatVariable}}, SendAll: {{ .SendAll }}, } {{end}}