mirror of
https://github.com/prometheus/statsd_exporter.git
synced 2024-11-22 07:20:59 +00:00
cleanup
Signed-off-by: glightfoot <glightfoot@rsglab.com>
This commit is contained in:
parent
32c612d5e8
commit
940e653ea6
6 changed files with 2 additions and 10 deletions
|
@ -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...)
|
||||
}
|
||||
|
||||
|
|
1
main.go
1
main.go
|
@ -492,7 +492,6 @@ func main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
mux := http.NewServeMux()
|
||||
|
|
|
@ -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))
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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{}
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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() {}
|
||||
|
||||
|
|
Loading…
Reference in a new issue