aboutsummaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
authorSimon Pasquier <spasquie@redhat.com>2019-09-13 12:23:26 +0200
committerSimon Pasquier <spasquie@redhat.com>2019-09-16 10:59:12 +0200
commitcfc06075d1b792763e91da0988ccd34e9a774e36 (patch)
tree81f5d741b6f71668002ea9cedc5edba4092d32e3 /vendor
parenta99ef58c4b7783e17576b8106e6825daabe26e10 (diff)
downloadprometheus_node_collector-cfc06075d1b792763e91da0988ccd34e9a774e36.tar.bz2
prometheus_node_collector-cfc06075d1b792763e91da0988ccd34e9a774e36.tar.xz
prometheus_node_collector-cfc06075d1b792763e91da0988ccd34e9a774e36.zip
Bump github.com/prometheus/common to v0.7.0
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Diffstat (limited to 'vendor')
-rw-r--r--vendor/github.com/alecthomas/template/go.mod1
-rw-r--r--vendor/github.com/alecthomas/units/go.mod1
-rw-r--r--vendor/github.com/golang/protobuf/proto/properties.go5
-rw-r--r--vendor/github.com/prometheus/common/expfmt/text_create.go18
-rw-r--r--vendor/github.com/prometheus/common/expfmt/text_parse.go13
-rw-r--r--vendor/modules.txt8
6 files changed, 26 insertions, 20 deletions
diff --git a/vendor/github.com/alecthomas/template/go.mod b/vendor/github.com/alecthomas/template/go.mod
new file mode 100644
index 0000000..a70670a
--- /dev/null
+++ b/vendor/github.com/alecthomas/template/go.mod
@@ -0,0 +1 @@
module github.com/alecthomas/template
diff --git a/vendor/github.com/alecthomas/units/go.mod b/vendor/github.com/alecthomas/units/go.mod
new file mode 100644
index 0000000..f572173
--- /dev/null
+++ b/vendor/github.com/alecthomas/units/go.mod
@@ -0,0 +1 @@
module github.com/alecthomas/units
diff --git a/vendor/github.com/golang/protobuf/proto/properties.go b/vendor/github.com/golang/protobuf/proto/properties.go
index 79668ff..a4b8c0c 100644
--- a/vendor/github.com/golang/protobuf/proto/properties.go
+++ b/vendor/github.com/golang/protobuf/proto/properties.go
@@ -38,7 +38,6 @@ package proto
38import ( 38import (
39 "fmt" 39 "fmt"
40 "log" 40 "log"
41 "os"
42 "reflect" 41 "reflect"
43 "sort" 42 "sort"
44 "strconv" 43 "strconv"
@@ -194,7 +193,7 @@ func (p *Properties) Parse(s string) {
194 // "bytes,49,opt,name=foo,def=hello!" 193 // "bytes,49,opt,name=foo,def=hello!"
195 fields := strings.Split(s, ",") // breaks def=, but handled below. 194 fields := strings.Split(s, ",") // breaks def=, but handled below.
196 if len(fields) < 2 { 195 if len(fields) < 2 {
197 fmt.Fprintf(os.Stderr, "proto: tag has too few fields: %q\n", s) 196 log.Printf("proto: tag has too few fields: %q", s)
198 return 197 return
199 } 198 }
200 199
@@ -214,7 +213,7 @@ func (p *Properties) Parse(s string) {
214 p.WireType = WireBytes 213 p.WireType = WireBytes
215 // no numeric converter for non-numeric types 214 // no numeric converter for non-numeric types
216 default: 215 default:
217 fmt.Fprintf(os.Stderr, "proto: tag has unknown wire type: %q\n", s) 216 log.Printf("proto: tag has unknown wire type: %q", s)
218 return 217 return
219 } 218 }
220 219
diff --git a/vendor/github.com/prometheus/common/expfmt/text_create.go b/vendor/github.com/prometheus/common/expfmt/text_create.go
index 8e473d0..0327865 100644
--- a/vendor/github.com/prometheus/common/expfmt/text_create.go
+++ b/vendor/github.com/prometheus/common/expfmt/text_create.go
@@ -14,9 +14,10 @@
14package expfmt 14package expfmt
15 15
16import ( 16import (
17 "bytes" 17 "bufio"
18 "fmt" 18 "fmt"
19 "io" 19 "io"
20 "io/ioutil"
20 "math" 21 "math"
21 "strconv" 22 "strconv"
22 "strings" 23 "strings"
@@ -27,7 +28,7 @@ import (
27 dto "github.com/prometheus/client_model/go" 28 dto "github.com/prometheus/client_model/go"
28) 29)
29 30
30// enhancedWriter has all the enhanced write functions needed here. bytes.Buffer 31// enhancedWriter has all the enhanced write functions needed here. bufio.Writer
31// implements it. 32// implements it.
32type enhancedWriter interface { 33type enhancedWriter interface {
33 io.Writer 34 io.Writer
@@ -37,14 +38,13 @@ type enhancedWriter interface {
37} 38}
38 39
39const ( 40const (
40 initialBufSize = 512
41 initialNumBufSize = 24 41 initialNumBufSize = 24
42) 42)
43 43
44var ( 44var (
45 bufPool = sync.Pool{ 45 bufPool = sync.Pool{
46 New: func() interface{} { 46 New: func() interface{} {
47 return bytes.NewBuffer(make([]byte, 0, initialBufSize)) 47 return bufio.NewWriter(ioutil.Discard)
48 }, 48 },
49 } 49 }
50 numBufPool = sync.Pool{ 50 numBufPool = sync.Pool{
@@ -75,16 +75,14 @@ func MetricFamilyToText(out io.Writer, in *dto.MetricFamily) (written int, err e
75 } 75 }
76 76
77 // Try the interface upgrade. If it doesn't work, we'll use a 77 // Try the interface upgrade. If it doesn't work, we'll use a
78 // bytes.Buffer from the sync.Pool and write out its content to out in a 78 // bufio.Writer from the sync.Pool.
79 // single go in the end.
80 w, ok := out.(enhancedWriter) 79 w, ok := out.(enhancedWriter)
81 if !ok { 80 if !ok {
82 b := bufPool.Get().(*bytes.Buffer) 81 b := bufPool.Get().(*bufio.Writer)
83 b.Reset() 82 b.Reset(out)
84 w = b 83 w = b
85 defer func() { 84 defer func() {
86 bWritten, bErr := out.Write(b.Bytes()) 85 bErr := b.Flush()
87 written = bWritten
88 if err == nil { 86 if err == nil {
89 err = bErr 87 err = bErr
90 } 88 }
diff --git a/vendor/github.com/prometheus/common/expfmt/text_parse.go b/vendor/github.com/prometheus/common/expfmt/text_parse.go
index ec3d86b..342e594 100644
--- a/vendor/github.com/prometheus/common/expfmt/text_parse.go
+++ b/vendor/github.com/prometheus/common/expfmt/text_parse.go
@@ -325,7 +325,7 @@ func (p *TextParser) startLabelValue() stateFn {
325 // - Other labels have to be added to currentLabels for signature calculation. 325 // - Other labels have to be added to currentLabels for signature calculation.
326 if p.currentMF.GetType() == dto.MetricType_SUMMARY { 326 if p.currentMF.GetType() == dto.MetricType_SUMMARY {
327 if p.currentLabelPair.GetName() == model.QuantileLabel { 327 if p.currentLabelPair.GetName() == model.QuantileLabel {
328 if p.currentQuantile, p.err = strconv.ParseFloat(p.currentLabelPair.GetValue(), 64); p.err != nil { 328 if p.currentQuantile, p.err = parseFloat(p.currentLabelPair.GetValue()); p.err != nil {
329 // Create a more helpful error message. 329 // Create a more helpful error message.
330 p.parseError(fmt.Sprintf("expected float as value for 'quantile' label, got %q", p.currentLabelPair.GetValue())) 330 p.parseError(fmt.Sprintf("expected float as value for 'quantile' label, got %q", p.currentLabelPair.GetValue()))
331 return nil 331 return nil
@@ -337,7 +337,7 @@ func (p *TextParser) startLabelValue() stateFn {
337 // Similar special treatment of histograms. 337 // Similar special treatment of histograms.
338 if p.currentMF.GetType() == dto.MetricType_HISTOGRAM { 338 if p.currentMF.GetType() == dto.MetricType_HISTOGRAM {
339 if p.currentLabelPair.GetName() == model.BucketLabel { 339 if p.currentLabelPair.GetName() == model.BucketLabel {
340 if p.currentBucket, p.err = strconv.ParseFloat(p.currentLabelPair.GetValue(), 64); p.err != nil { 340 if p.currentBucket, p.err = parseFloat(p.currentLabelPair.GetValue()); p.err != nil {
341 // Create a more helpful error message. 341 // Create a more helpful error message.
342 p.parseError(fmt.Sprintf("expected float as value for 'le' label, got %q", p.currentLabelPair.GetValue())) 342 p.parseError(fmt.Sprintf("expected float as value for 'le' label, got %q", p.currentLabelPair.GetValue()))
343 return nil 343 return nil
@@ -392,7 +392,7 @@ func (p *TextParser) readingValue() stateFn {
392 if p.readTokenUntilWhitespace(); p.err != nil { 392 if p.readTokenUntilWhitespace(); p.err != nil {
393 return nil // Unexpected end of input. 393 return nil // Unexpected end of input.
394 } 394 }
395 value, err := strconv.ParseFloat(p.currentToken.String(), 64) 395 value, err := parseFloat(p.currentToken.String())
396 if err != nil { 396 if err != nil {
397 // Create a more helpful error message. 397 // Create a more helpful error message.
398 p.parseError(fmt.Sprintf("expected float as value, got %q", p.currentToken.String())) 398 p.parseError(fmt.Sprintf("expected float as value, got %q", p.currentToken.String()))
@@ -755,3 +755,10 @@ func histogramMetricName(name string) string {
755 return name 755 return name
756 } 756 }
757} 757}
758
759func parseFloat(s string) (float64, error) {
760 if strings.ContainsAny(s, "pP_") {
761 return 0, fmt.Errorf("unsupported character in float")
762 }
763 return strconv.ParseFloat(s, 64)
764}
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 7cf21f7..416ae83 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -1,7 +1,7 @@
1# github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc 1# github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
2github.com/alecthomas/template 2github.com/alecthomas/template
3github.com/alecthomas/template/parse 3github.com/alecthomas/template/parse
4# github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf 4# github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4
5github.com/alecthomas/units 5github.com/alecthomas/units
6# github.com/beevik/ntp v0.2.0 6# github.com/beevik/ntp v0.2.0
7github.com/beevik/ntp 7github.com/beevik/ntp
@@ -13,7 +13,7 @@ github.com/coreos/go-systemd/dbus
13github.com/ema/qdisc 13github.com/ema/qdisc
14# github.com/godbus/dbus v0.0.0-20190402143921-271e53dc4968 14# github.com/godbus/dbus v0.0.0-20190402143921-271e53dc4968
15github.com/godbus/dbus 15github.com/godbus/dbus
16# github.com/golang/protobuf v1.3.1 16# github.com/golang/protobuf v1.3.2
17github.com/golang/protobuf/proto 17github.com/golang/protobuf/proto
18# github.com/hodgesds/perf-utils v0.0.7 18# github.com/hodgesds/perf-utils v0.0.7
19github.com/hodgesds/perf-utils 19github.com/hodgesds/perf-utils
@@ -39,7 +39,7 @@ github.com/prometheus/client_golang/prometheus/internal
39github.com/prometheus/client_golang/prometheus/promhttp 39github.com/prometheus/client_golang/prometheus/promhttp
40# github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 40# github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90
41github.com/prometheus/client_model/go 41github.com/prometheus/client_model/go
42# github.com/prometheus/common v0.4.1 42# github.com/prometheus/common v0.7.0
43github.com/prometheus/common/expfmt 43github.com/prometheus/common/expfmt
44github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg 44github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg
45github.com/prometheus/common/log 45github.com/prometheus/common/log