Этот коммит содержится в:
Christopher Speller
2019-01-24 16:35:21 -08:00
коммит произвёл GitHub
родитель 8af05aa43a
Коммит 9168482623
369 изменённых файлов: 52447 добавлений и 11468 удалений

4
vendor/github.com/prometheus/client_golang/prometheus/desc.go сгенерированный поставляемый
Просмотреть файл

@@ -93,7 +93,7 @@ func NewDesc(fqName, help string, variableLabels []string, constLabels Labels) *
// First add only the const label names and sort them...
for labelName := range constLabels {
if !checkLabelName(labelName) {
d.err = fmt.Errorf("%q is not a valid label name", labelName)
d.err = fmt.Errorf("%q is not a valid label name for metric %q", labelName, fqName)
return d
}
labelNames = append(labelNames, labelName)
@@ -115,7 +115,7 @@ func NewDesc(fqName, help string, variableLabels []string, constLabels Labels) *
// dimension with a different mix between preset and variable labels.
for _, labelName := range variableLabels {
if !checkLabelName(labelName) {
d.err = fmt.Errorf("%q is not a valid label name", labelName)
d.err = fmt.Errorf("%q is not a valid label name for metric %q", labelName, fqName)
return d
}
labelNames = append(labelNames, "$"+labelName)

12
vendor/github.com/prometheus/client_golang/prometheus/registry.go сгенерированный поставляемый
Просмотреть файл

@@ -872,7 +872,13 @@ func checkMetricConsistency(
h = hashAddByte(h, separatorByte)
// Make sure label pairs are sorted. We depend on it for the consistency
// check.
sort.Sort(labelPairSorter(dtoMetric.Label))
if !sort.IsSorted(labelPairSorter(dtoMetric.Label)) {
// We cannot sort dtoMetric.Label in place as it is immutable by contract.
copiedLabels := make([]*dto.LabelPair, len(dtoMetric.Label))
copy(copiedLabels, dtoMetric.Label)
sort.Sort(labelPairSorter(copiedLabels))
dtoMetric.Label = copiedLabels
}
for _, lp := range dtoMetric.Label {
h = hashAdd(h, lp.GetName())
h = hashAddByte(h, separatorByte)
@@ -903,8 +909,8 @@ func checkDescConsistency(
}
// Is the desc consistent with the content of the metric?
lpsFromDesc := make([]*dto.LabelPair, 0, len(dtoMetric.Label))
lpsFromDesc = append(lpsFromDesc, desc.constLabelPairs...)
lpsFromDesc := make([]*dto.LabelPair, len(desc.constLabelPairs), len(dtoMetric.Label))
copy(lpsFromDesc, desc.constLabelPairs)
for _, l := range desc.variableLabels {
lpsFromDesc = append(lpsFromDesc, &dto.LabelPair{
Name: proto.String(l),

11
vendor/github.com/prometheus/client_golang/prometheus/timer.go сгенерированный поставляемый
Просмотреть файл

@@ -39,13 +39,16 @@ func NewTimer(o Observer) *Timer {
// ObserveDuration records the duration passed since the Timer was created with
// NewTimer. It calls the Observe method of the Observer provided during
// construction with the duration in seconds as an argument. ObserveDuration is
// usually called with a defer statement.
// construction with the duration in seconds as an argument. The observed
// duration is also returned. ObserveDuration is usually called with a defer
// statement.
//
// Note that this method is only guaranteed to never observe negative durations
// if used with Go1.9+.
func (t *Timer) ObserveDuration() {
func (t *Timer) ObserveDuration() time.Duration {
d := time.Since(t.begin)
if t.observer != nil {
t.observer.Observe(time.Since(t.begin).Seconds())
t.observer.Observe(d.Seconds())
}
return d
}

12
vendor/github.com/prometheus/common/expfmt/text_create.go сгенерированный поставляемый
Просмотреть файл

@@ -436,11 +436,11 @@ func writeEscapedString(w enhancedWriter, v string, includeDoubleQuote bool) (in
func writeFloat(w enhancedWriter, f float64) (int, error) {
switch {
case f == 1:
return 1, w.WriteByte('1')
return w.WriteString("1.0")
case f == 0:
return 1, w.WriteByte('0')
return w.WriteString("0.0")
case f == -1:
return w.WriteString("-1")
return w.WriteString("-1.0")
case math.IsNaN(f):
return w.WriteString("NaN")
case math.IsInf(f, +1):
@@ -450,6 +450,12 @@ func writeFloat(w enhancedWriter, f float64) (int, error) {
default:
bp := numBufPool.Get().(*[]byte)
*bp = strconv.AppendFloat((*bp)[:0], f, 'g', -1, 64)
// Add a .0 if used fixed point and there is no decimal
// point already. This is for future proofing with OpenMetrics,
// where floats always contain either an exponent or decimal.
if !bytes.ContainsAny(*bp, "e.") {
*bp = append(*bp, '.', '0')
}
written, err := w.Write(*bp)
numBufPool.Put(bp)
return written, err

6
vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/autoneg.go сгенерированный поставляемый
Просмотреть файл

@@ -1,12 +1,12 @@
/*
Copyright (c) 2011, Open Knowledge Foundation Ltd.
All rights reserved.
HTTP Content-Type Autonegotiation.
The functions in this package implement the behaviour specified in
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
Copyright (c) 2011, Open Knowledge Foundation Ltd.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

1
vendor/github.com/prometheus/common/model/metric.go сгенерированный поставляемый
Просмотреть файл

@@ -21,7 +21,6 @@ import (
)
var (
separator = []byte{0}
// MetricNameRE is a regular expression matching valid metric
// names. Note that the IsValidMetricName function performs the same
// check but faster than a match with this regular expression.

3
vendor/github.com/prometheus/procfs/MAINTAINERS.md сгенерированный поставляемый
Просмотреть файл

@@ -1 +1,2 @@
* Tobias Schmidt <tobidt@gmail.com>
* Tobias Schmidt <tobidt@gmail.com> @grobie
* Johannes 'fish' Ziemke <github@freigeist.org> @discordianfish

18
vendor/github.com/prometheus/procfs/xfs/parse.go сгенерированный поставляемый
Просмотреть файл

@@ -43,15 +43,15 @@ func ParseStats(r io.Reader) (*Stats, error) {
fieldXpc = "xpc"
// Unimplemented at this time due to lack of documentation.
fieldPushAil = "push_ail"
fieldXstrat = "xstrat"
fieldAbtb2 = "abtb2"
fieldAbtc2 = "abtc2"
fieldBmbt2 = "bmbt2"
fieldIbt2 = "ibt2"
fieldFibt2 = "fibt2"
fieldQm = "qm"
fieldDebug = "debug"
// fieldPushAil = "push_ail"
// fieldXstrat = "xstrat"
// fieldAbtb2 = "abtb2"
// fieldAbtc2 = "abtc2"
// fieldBmbt2 = "bmbt2"
// fieldIbt2 = "ibt2"
// fieldFibt2 = "fibt2"
// fieldQm = "qm"
// fieldDebug = "debug"
)
var xfss Stats