1
0
mirror of https://github.com/nginxinc/nginx-prometheus-exporter.git synced 2025-07-30 10:03:04 +03:00

Run gofumports in the project

This commit is contained in:
Luca Comellini
2021-06-22 17:38:59 -07:00
parent 526178659d
commit ee84be3e5a
2 changed files with 5 additions and 3 deletions

View File

@ -5,7 +5,7 @@ import "testing"
const validStabStats = "Active connections: 1457 \nserver accepts handled requests\n 6717066 6717066 65844359 \nReading: 1 Writing: 8 Waiting: 1448 \n" const validStabStats = "Active connections: 1457 \nserver accepts handled requests\n 6717066 6717066 65844359 \nReading: 1 Writing: 8 Waiting: 1448 \n"
func TestParseStubStatsValidInput(t *testing.T) { func TestParseStubStatsValidInput(t *testing.T) {
var tests = []struct { tests := []struct {
input []byte input []byte
expectedResult StubStats expectedResult StubStats
expectedError bool expectedError bool

View File

@ -4,8 +4,10 @@ import (
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
) )
const nginxUp = 1 const (
const nginxDown = 0 nginxUp = 1
nginxDown = 0
)
func newGlobalMetric(namespace string, metricName string, docString string, constLabels map[string]string) *prometheus.Desc { func newGlobalMetric(namespace string, metricName string, docString string, constLabels map[string]string) *prometheus.Desc {
return prometheus.NewDesc(namespace+"_"+metricName, docString, nil, constLabels) return prometheus.NewDesc(namespace+"_"+metricName, docString, nil, constLabels)