You've already forked nginx_exporter
mirror of
https://github.com/nginxinc/nginx-prometheus-exporter.git
synced 2025-07-08 10:41:56 +03:00
2
Makefile
2
Makefile
@ -25,7 +25,7 @@ lint:
|
|||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test:
|
||||||
go test ./...
|
go test ./... -race -shuffle=on
|
||||||
|
|
||||||
.PHONY: container
|
.PHONY: container
|
||||||
container:
|
container:
|
||||||
|
@ -8,6 +8,8 @@ import (
|
|||||||
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) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
input []byte
|
input []byte
|
||||||
expectedResult StubStats
|
expectedResult StubStats
|
||||||
|
@ -6,6 +6,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestMergeLabels(t *testing.T) {
|
func TestMergeLabels(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
mapA, mapB, want map[string]string
|
mapA, mapB, want map[string]string
|
||||||
|
@ -206,7 +206,8 @@ type VariableLabelNames struct {
|
|||||||
|
|
||||||
// NewVariableLabels creates a new struct for VariableNames for the collector
|
// NewVariableLabels creates a new struct for VariableNames for the collector
|
||||||
func NewVariableLabelNames(upstreamServerVariableLabelNames []string, serverZoneVariableLabelNames []string, upstreamServerPeerVariableLabelNames []string,
|
func NewVariableLabelNames(upstreamServerVariableLabelNames []string, serverZoneVariableLabelNames []string, upstreamServerPeerVariableLabelNames []string,
|
||||||
streamUpstreamServerVariableLabelNames []string, streamServerZoneLabels []string, streamUpstreamServerPeerVariableLabelNames []string) VariableLabelNames {
|
streamUpstreamServerVariableLabelNames []string, streamServerZoneLabels []string, streamUpstreamServerPeerVariableLabelNames []string,
|
||||||
|
) VariableLabelNames {
|
||||||
return VariableLabelNames{
|
return VariableLabelNames{
|
||||||
UpstreamServerVariableLabelNames: upstreamServerVariableLabelNames,
|
UpstreamServerVariableLabelNames: upstreamServerVariableLabelNames,
|
||||||
ServerZoneVariableLabelNames: serverZoneVariableLabelNames,
|
ServerZoneVariableLabelNames: serverZoneVariableLabelNames,
|
||||||
|
@ -8,6 +8,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestCreateClientWithRetries(t *testing.T) {
|
func TestCreateClientWithRetries(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
type args struct {
|
type args struct {
|
||||||
client interface{}
|
client interface{}
|
||||||
err error
|
err error
|
||||||
@ -83,6 +85,8 @@ func TestCreateClientWithRetries(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestParsePositiveDuration(t *testing.T) {
|
func TestParsePositiveDuration(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
testInput string
|
testInput string
|
||||||
@ -123,6 +127,8 @@ func TestParsePositiveDuration(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestParseUnixSocketAddress(t *testing.T) {
|
func TestParseUnixSocketAddress(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
testInput string
|
testInput string
|
||||||
@ -177,6 +183,8 @@ func TestParseUnixSocketAddress(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestParseConstLabels(t *testing.T) {
|
func TestParseConstLabels(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
labels string
|
labels string
|
||||||
|
Reference in New Issue
Block a user