tests: remove redundant newlines that go 1.18 treats as errors (#10847)
This commit is contained in:
parent
77040ef4e9
commit
5992fc47ac
|
|
@ -63,5 +63,4 @@ Examples:
|
||||||
telegraf --config telegraf.conf --input-filter cpu:mem --output-filter influxdb
|
telegraf --config telegraf.conf --input-filter cpu:mem --output-filter influxdb
|
||||||
|
|
||||||
# run telegraf with pprof
|
# run telegraf with pprof
|
||||||
telegraf --config telegraf.conf --pprof-addr localhost:6060
|
telegraf --config telegraf.conf --pprof-addr localhost:6060`
|
||||||
`
|
|
||||||
|
|
|
||||||
|
|
@ -77,5 +77,4 @@ Examples:
|
||||||
telegraf --service install --service-name=my-telegraf --service-display-name="My Telegraf"
|
telegraf --service install --service-name=my-telegraf --service-display-name="My Telegraf"
|
||||||
|
|
||||||
# install telegraf service with auto restart and restart delay of 3 minutes
|
# install telegraf service with auto restart and restart delay of 3 minutes
|
||||||
telegraf --service install --service-auto-restart --service-restart-delay 3m
|
telegraf --service install --service-auto-restart --service-restart-delay 3m`
|
||||||
`
|
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,8 @@ go_gc_duration_seconds_count 7
|
||||||
go_goroutines 15
|
go_goroutines 15
|
||||||
# HELP test_metric An untyped metric with a timestamp
|
# HELP test_metric An untyped metric with a timestamp
|
||||||
# TYPE test_metric untyped
|
# TYPE test_metric untyped
|
||||||
test_metric{label="value"} 1.0 1490802350000
|
test_metric{label="value"} 1.0 1490802350000`
|
||||||
`
|
|
||||||
const sampleSummaryTextFormat = `# HELP go_gc_duration_seconds A summary of the GC invocation durations.
|
const sampleSummaryTextFormat = `# HELP go_gc_duration_seconds A summary of the GC invocation durations.
|
||||||
# TYPE go_gc_duration_seconds summary
|
# TYPE go_gc_duration_seconds summary
|
||||||
go_gc_duration_seconds{quantile="0"} 0.00010425500000000001
|
go_gc_duration_seconds{quantile="0"} 0.00010425500000000001
|
||||||
|
|
@ -41,13 +41,12 @@ go_gc_duration_seconds{quantile="0.5"} 0.00015749400000000002
|
||||||
go_gc_duration_seconds{quantile="0.75"} 0.000331463
|
go_gc_duration_seconds{quantile="0.75"} 0.000331463
|
||||||
go_gc_duration_seconds{quantile="1"} 0.000667154
|
go_gc_duration_seconds{quantile="1"} 0.000667154
|
||||||
go_gc_duration_seconds_sum 0.0018183950000000002
|
go_gc_duration_seconds_sum 0.0018183950000000002
|
||||||
go_gc_duration_seconds_count 7
|
go_gc_duration_seconds_count 7`
|
||||||
`
|
|
||||||
const sampleGaugeTextFormat = `
|
const sampleGaugeTextFormat = `
|
||||||
# HELP go_goroutines Number of goroutines that currently exist.
|
# HELP go_goroutines Number of goroutines that currently exist.
|
||||||
# TYPE go_goroutines gauge
|
# TYPE go_goroutines gauge
|
||||||
go_goroutines 15 1490802350000
|
go_goroutines 15 1490802350000`
|
||||||
`
|
|
||||||
|
|
||||||
func TestPrometheusGeneratesMetrics(t *testing.T) {
|
func TestPrometheusGeneratesMetrics(t *testing.T) {
|
||||||
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
@ -161,8 +160,8 @@ func TestSummaryMayContainNaN(t *testing.T) {
|
||||||
go_gc_duration_seconds{quantile="0"} NaN
|
go_gc_duration_seconds{quantile="0"} NaN
|
||||||
go_gc_duration_seconds{quantile="1"} NaN
|
go_gc_duration_seconds{quantile="1"} NaN
|
||||||
go_gc_duration_seconds_sum 42.0
|
go_gc_duration_seconds_sum 42.0
|
||||||
go_gc_duration_seconds_count 42
|
go_gc_duration_seconds_count 42`
|
||||||
`
|
|
||||||
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
_, err := fmt.Fprintln(w, data)
|
_, err := fmt.Fprintln(w, data)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
|
||||||
|
|
@ -727,8 +727,7 @@ const mBeansSolr3MainResponse = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}`
|
||||||
`
|
|
||||||
|
|
||||||
var solr3CoreExpected = map[string]interface{}{
|
var solr3CoreExpected = map[string]interface{}{
|
||||||
"num_docs": int64(117166),
|
"num_docs": int64(117166),
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,7 @@ const mBeansSolr7Response = `
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}`
|
||||||
`
|
|
||||||
|
|
||||||
var solr7CacheExpected = map[string]interface{}{
|
var solr7CacheExpected = map[string]interface{}{
|
||||||
"evictions": int64(141485),
|
"evictions": int64(141485),
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,7 @@ const statusResponse = `
|
||||||
"QTime": 13,
|
"QTime": 13,
|
||||||
"status": 0
|
"status": 0
|
||||||
}
|
}
|
||||||
}
|
}`
|
||||||
`
|
|
||||||
|
|
||||||
const mBeansMainResponse = `{
|
const mBeansMainResponse = `{
|
||||||
"solr-mbeans": [
|
"solr-mbeans": [
|
||||||
|
|
@ -905,8 +904,7 @@ const mBeansMainResponse = `{
|
||||||
"QTime": 8,
|
"QTime": 8,
|
||||||
"status": 0
|
"status": 0
|
||||||
}
|
}
|
||||||
}
|
}`
|
||||||
`
|
|
||||||
|
|
||||||
const mBeansCore1Response = `{
|
const mBeansCore1Response = `{
|
||||||
"solr-mbeans": [
|
"solr-mbeans": [
|
||||||
|
|
@ -1748,8 +1746,7 @@ const mBeansCore1Response = `{
|
||||||
"QTime": 5,
|
"QTime": 5,
|
||||||
"status": 0
|
"status": 0
|
||||||
}
|
}
|
||||||
}
|
}`
|
||||||
`
|
|
||||||
|
|
||||||
var solrAdminMainCoreStatusExpected = map[string]interface{}{
|
var solrAdminMainCoreStatusExpected = map[string]interface{}{
|
||||||
"num_docs": int64(168943425),
|
"num_docs": int64(168943425),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue