Signed-off-by: glightfoot <glightfoot@rsglab.com>
This commit is contained in:
glightfoot 2021-02-06 23:21:49 -05:00
parent 32c612d5e8
commit 940e653ea6
6 changed files with 2 additions and 10 deletions

View file

@ -572,7 +572,7 @@ func TestHandlePacket(t *testing.T) {
le := len(events)
// Flatten actual events.
actual := event.Events{}
for i := 0; i < le; i++ {
for j := 0; j < le; j++ {
actual = append(actual, <-events...)
}

View file

@ -492,7 +492,6 @@ func main() {
}
}
}
}
mux := http.NewServeMux()

View file

@ -84,5 +84,4 @@ func TestEventIntervalFlush(t *testing.T) {
if len(events) != 10 {
t.Fatal("Expected 10 events in the event channel, but got", len(events))
}
}

View file

@ -55,7 +55,6 @@ type Exporter struct {
// Listen handles all events sent to the given channel sequentially. It
// terminates when the channel is closed.
func (b *Exporter) Listen(e <-chan event.Events) {
removeStaleMetricsTicker := clock.NewTicker(time.Second)
for {
@ -77,7 +76,6 @@ func (b *Exporter) Listen(e <-chan event.Events) {
// handleEvent processes a single Event according to the configured mapping.
func (b *Exporter) handleEvent(thisEvent event.Event) {
mapping, labels, present := b.Mapper.GetMapping(thisEvent.MetricName(), thisEvent.MetricType())
if mapping == nil {
mapping = &mapper.MetricMapping{}

View file

@ -144,7 +144,6 @@ func (m *MetricMapper) InitFromYAMLString(fileContents string) error {
}
currentMapping.labelFormatters = labelFormatters
currentMapping.labelKeys = labelKeys
} else {
if regex, err := regexp.Compile(currentMapping.Match); err != nil {
return fmt.Errorf("invalid regex %s in mapping: %v", currentMapping.Match, err)
@ -222,7 +221,6 @@ func (m *MetricMapper) InitFromYAMLString(fileContents string) error {
if currentMapping.Ttl == 0 && n.Defaults.Ttl > 0 {
currentMapping.Ttl = n.Defaults.Ttl
}
}
m.mutex.Lock()

View file

@ -79,9 +79,7 @@ func (m *MetricMapperNoopCache) Get(metricKey string) (interface{}, bool) {
return nil, false
}
func (m *MetricMapperNoopCache) Add(metricKey string, result interface{}) {
return
}
func (m *MetricMapperNoopCache) Add(metricKey string, result interface{}) {}
func (m *MetricMapperNoopCache) Reset() {}