forked from mirrors/statsd_exporter
Fixing linting problems on new code
Signed-off-by: Pedro Tanaka <pedro.tanaka@shopify.com>
This commit is contained in:
parent
d015cda365
commit
fbf7837387
2 changed files with 7 additions and 6 deletions
|
@ -16,11 +16,12 @@ package relay
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/prometheus/statsd_exporter/pkg/clock"
|
|
||||||
"net"
|
"net"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/prometheus/statsd_exporter/pkg/clock"
|
||||||
|
|
||||||
"github.com/go-kit/log"
|
"github.com/go-kit/log"
|
||||||
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
|
|
|
@ -2,13 +2,14 @@ package relay
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/go-kit/log"
|
"github.com/go-kit/log"
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
dto "github.com/prometheus/client_model/go"
|
dto "github.com/prometheus/client_model/go"
|
||||||
"github.com/prometheus/statsd_exporter/pkg/clock"
|
"github.com/prometheus/statsd_exporter/pkg/clock"
|
||||||
"github.com/stvp/go-udp-testing"
|
"github.com/stvp/go-udp-testing"
|
||||||
"testing"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRelay_RelayLine(t *testing.T) {
|
func TestRelay_RelayLine(t *testing.T) {
|
||||||
|
@ -33,7 +34,6 @@ func TestRelay_RelayLine(t *testing.T) {
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
udp.SetAddr(":1160")
|
udp.SetAddr(":1160")
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
|
||||||
tickerCh := make(chan time.Time)
|
tickerCh := make(chan time.Time)
|
||||||
clock.ClockInstance = &clock.Clock{
|
clock.ClockInstance = &clock.Clock{
|
||||||
TickerCh: tickerCh,
|
TickerCh: tickerCh,
|
||||||
|
@ -56,8 +56,8 @@ func TestRelay_RelayLine(t *testing.T) {
|
||||||
r.RelayLine(line)
|
r.RelayLine(line)
|
||||||
}
|
}
|
||||||
// Tick time forward to trigger a packet send.
|
// Tick time forward to trigger a packet send.
|
||||||
clock.ClockInstance.Instant = time.Unix(20000, 0)
|
clock.ClockInstance.Instant = time.Unix(1, 10)
|
||||||
clock.ClockInstance.TickerCh <- time.Unix(20000, 0)
|
clock.ClockInstance.TickerCh <- time.Unix(0, 0)
|
||||||
})
|
})
|
||||||
|
|
||||||
metrics, err := prometheus.DefaultGatherer.Gather()
|
metrics, err := prometheus.DefaultGatherer.Gather()
|
||||||
|
|
Loading…
Reference in a new issue