diff options
Diffstat (limited to 'vendor/github.com/prometheus/client_golang/prometheus/examples_test.go')
-rw-r--r-- | vendor/github.com/prometheus/client_golang/prometheus/examples_test.go | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/examples_test.go b/vendor/github.com/prometheus/client_golang/prometheus/examples_test.go index 45f60650f..f87f21a8f 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/examples_test.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/examples_test.go @@ -113,7 +113,7 @@ func ExampleCounter() { pushComplete := make(chan struct{}) // TODO: Start a goroutine that performs repository pushes and reports // each completion via the channel. - for range pushComplete { + for _ = range pushComplete { pushCounter.Inc() } // Output: @@ -169,8 +169,8 @@ func ExampleInstrumentHandler() { func ExampleLabelPairSorter() { labelPairs := []*dto.LabelPair{ - {Name: proto.String("status"), Value: proto.String("404")}, - {Name: proto.String("method"), Value: proto.String("get")}, + &dto.LabelPair{Name: proto.String("status"), Value: proto.String("404")}, + &dto.LabelPair{Name: proto.String("method"), Value: proto.String("get")}, } sort.Sort(prometheus.LabelPairSorter(labelPairs)) @@ -334,9 +334,8 @@ func ExampleRegister() { func ExampleSummary() { temps := prometheus.NewSummary(prometheus.SummaryOpts{ - Name: "pond_temperature_celsius", - Help: "The temperature of the frog pond.", - Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}, + Name: "pond_temperature_celsius", + Help: "The temperature of the frog pond.", // Sorry, we can't measure how badly it smells. }) // Simulate some observations. @@ -373,9 +372,8 @@ func ExampleSummary() { func ExampleSummaryVec() { temps := prometheus.NewSummaryVec( prometheus.SummaryOpts{ - Name: "pond_temperature_celsius", - Help: "The temperature of the frog pond.", - Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}, + Name: "pond_temperature_celsius", + Help: "The temperature of the frog pond.", // Sorry, we can't measure how badly it smells. }, []string{"species"}, ) @@ -642,7 +640,6 @@ func ExampleAlreadyRegisteredError() { panic(err) } } - reqCounter.Inc() } func ExampleGatherers() { |