mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-10 07:34:04 -08:00
update common package (#4015)
This commit is contained in:
parent
5fec98d0a7
commit
dfd6709a44
2
vendor/github.com/prometheus/common/expfmt/expfmt.go
generated
vendored
2
vendor/github.com/prometheus/common/expfmt/expfmt.go
generated
vendored
|
@ -26,7 +26,7 @@ const (
|
||||||
|
|
||||||
// The Content-Type values for the different wire protocols.
|
// The Content-Type values for the different wire protocols.
|
||||||
FmtUnknown Format = `<unknown>`
|
FmtUnknown Format = `<unknown>`
|
||||||
FmtText Format = `text/plain; version=` + TextVersion
|
FmtText Format = `text/plain; version=` + TextVersion + `; charset=utf-8`
|
||||||
FmtProtoDelim Format = ProtoFmt + ` encoding=delimited`
|
FmtProtoDelim Format = ProtoFmt + ` encoding=delimited`
|
||||||
FmtProtoText Format = ProtoFmt + ` encoding=text`
|
FmtProtoText Format = ProtoFmt + ` encoding=text`
|
||||||
FmtProtoCompact Format = ProtoFmt + ` encoding=compact-text`
|
FmtProtoCompact Format = ProtoFmt + ` encoding=compact-text`
|
||||||
|
|
3
vendor/github.com/prometheus/common/model/time.go
generated
vendored
3
vendor/github.com/prometheus/common/model/time.go
generated
vendored
|
@ -214,6 +214,9 @@ func (d Duration) String() string {
|
||||||
ms = int64(time.Duration(d) / time.Millisecond)
|
ms = int64(time.Duration(d) / time.Millisecond)
|
||||||
unit = "ms"
|
unit = "ms"
|
||||||
)
|
)
|
||||||
|
if ms == 0 {
|
||||||
|
return "0s"
|
||||||
|
}
|
||||||
factors := map[string]int64{
|
factors := map[string]int64{
|
||||||
"y": 1000 * 60 * 60 * 24 * 365,
|
"y": 1000 * 60 * 60 * 24 * 365,
|
||||||
"w": 1000 * 60 * 60 * 24 * 7,
|
"w": 1000 * 60 * 60 * 24 * 7,
|
||||||
|
|
7
vendor/github.com/prometheus/common/route/route.go
generated
vendored
7
vendor/github.com/prometheus/common/route/route.go
generated
vendored
|
@ -46,6 +46,10 @@ func (r *Router) WithPrefix(prefix string) *Router {
|
||||||
|
|
||||||
// handle turns a HandlerFunc into an httprouter.Handle.
|
// handle turns a HandlerFunc into an httprouter.Handle.
|
||||||
func (r *Router) handle(handlerName string, h http.HandlerFunc) httprouter.Handle {
|
func (r *Router) handle(handlerName string, h http.HandlerFunc) httprouter.Handle {
|
||||||
|
if r.instrh != nil {
|
||||||
|
// This needs to be outside the closure to avoid data race when reading and writing to 'h'.
|
||||||
|
h = r.instrh(handlerName, h)
|
||||||
|
}
|
||||||
return func(w http.ResponseWriter, req *http.Request, params httprouter.Params) {
|
return func(w http.ResponseWriter, req *http.Request, params httprouter.Params) {
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
@ -53,9 +57,6 @@ func (r *Router) handle(handlerName string, h http.HandlerFunc) httprouter.Handl
|
||||||
for _, p := range params {
|
for _, p := range params {
|
||||||
ctx = context.WithValue(ctx, param(p.Key), p.Value)
|
ctx = context.WithValue(ctx, param(p.Key), p.Value)
|
||||||
}
|
}
|
||||||
if r.instrh != nil {
|
|
||||||
h = r.instrh(handlerName, h)
|
|
||||||
}
|
|
||||||
h(w, req.WithContext(ctx))
|
h(w, req.WithContext(ctx))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
38
vendor/vendor.json
vendored
38
vendor/vendor.json
vendored
|
@ -762,50 +762,50 @@
|
||||||
{
|
{
|
||||||
"checksumSHA1": "i+0TxE6bOpJdPNOeNHpO0vMzFh4=",
|
"checksumSHA1": "i+0TxE6bOpJdPNOeNHpO0vMzFh4=",
|
||||||
"path": "github.com/prometheus/common/config",
|
"path": "github.com/prometheus/common/config",
|
||||||
"revision": "89604d197083d4781071d3c65855d24ecfb0a563",
|
"revision": "38c53a9f4bfcd932d1b00bfc65e256a7fba6b37a",
|
||||||
"revisionTime": "2018-01-10T21:49:58Z"
|
"revisionTime": "2018-03-26T16:04:09Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "xfnn0THnqNwjwimeTClsxahYrIo=",
|
"checksumSHA1": "+wZ+Pa6NX+NOxUvayXBXGOcqFe8=",
|
||||||
"path": "github.com/prometheus/common/expfmt",
|
"path": "github.com/prometheus/common/expfmt",
|
||||||
"revision": "e3fb1a1acd7605367a2b378bc2e2f893c05174b7",
|
"revision": "38c53a9f4bfcd932d1b00bfc65e256a7fba6b37a",
|
||||||
"revisionTime": "2017-11-04T09:59:07Z"
|
"revisionTime": "2018-03-26T16:04:09Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "GWlM3d2vPYyNATtTFgftS10/A9w=",
|
"checksumSHA1": "GWlM3d2vPYyNATtTFgftS10/A9w=",
|
||||||
"path": "github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg",
|
"path": "github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg",
|
||||||
"revision": "e3fb1a1acd7605367a2b378bc2e2f893c05174b7",
|
"revision": "38c53a9f4bfcd932d1b00bfc65e256a7fba6b37a",
|
||||||
"revisionTime": "2017-11-04T09:59:07Z"
|
"revisionTime": "2018-03-26T16:04:09Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "3VoqH7TFfzA6Ds0zFzIbKCUvBmw=",
|
"checksumSHA1": "YU+/K48IMawQnToO4ETE6a+hhj4=",
|
||||||
"path": "github.com/prometheus/common/model",
|
"path": "github.com/prometheus/common/model",
|
||||||
"revision": "e3fb1a1acd7605367a2b378bc2e2f893c05174b7",
|
"revision": "38c53a9f4bfcd932d1b00bfc65e256a7fba6b37a",
|
||||||
"revisionTime": "2017-11-04T09:59:07Z"
|
"revisionTime": "2018-03-26T16:04:09Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "Yseprf8kAFr/s7wztkQnrFuFN+8=",
|
"checksumSHA1": "Yseprf8kAFr/s7wztkQnrFuFN+8=",
|
||||||
"path": "github.com/prometheus/common/promlog",
|
"path": "github.com/prometheus/common/promlog",
|
||||||
"revision": "e3fb1a1acd7605367a2b378bc2e2f893c05174b7",
|
"revision": "38c53a9f4bfcd932d1b00bfc65e256a7fba6b37a",
|
||||||
"revisionTime": "2017-11-04T09:59:07Z"
|
"revisionTime": "2018-03-26T16:04:09Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "1H28FCxsaAIm6kvue+Wfdd8Lq6M=",
|
"checksumSHA1": "1H28FCxsaAIm6kvue+Wfdd8Lq6M=",
|
||||||
"path": "github.com/prometheus/common/promlog/flag",
|
"path": "github.com/prometheus/common/promlog/flag",
|
||||||
"revision": "e3fb1a1acd7605367a2b378bc2e2f893c05174b7",
|
"revision": "38c53a9f4bfcd932d1b00bfc65e256a7fba6b37a",
|
||||||
"revisionTime": "2017-11-04T09:59:07Z"
|
"revisionTime": "2018-03-26T16:04:09Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "h6H+CjfOU6FfHV8cLWHN1VhAqp8=",
|
"checksumSHA1": "9doPk0x0LONG/idxK61JnZYcxBs=",
|
||||||
"path": "github.com/prometheus/common/route",
|
"path": "github.com/prometheus/common/route",
|
||||||
"revision": "e4aa40a9169a88835b849a6efb71e05dc04b88f0",
|
"revision": "38c53a9f4bfcd932d1b00bfc65e256a7fba6b37a",
|
||||||
"revisionTime": "2018-03-12T11:28:59Z"
|
"revisionTime": "2018-03-26T16:04:09Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "91KYK0SpvkaMJJA2+BcxbVnyRO0=",
|
"checksumSHA1": "91KYK0SpvkaMJJA2+BcxbVnyRO0=",
|
||||||
"path": "github.com/prometheus/common/version",
|
"path": "github.com/prometheus/common/version",
|
||||||
"revision": "e3fb1a1acd7605367a2b378bc2e2f893c05174b7",
|
"revision": "38c53a9f4bfcd932d1b00bfc65e256a7fba6b37a",
|
||||||
"revisionTime": "2017-11-04T09:59:07Z"
|
"revisionTime": "2018-03-26T16:04:09Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "W218eJZPXJG783fUr/z6IaAZyes=",
|
"checksumSHA1": "W218eJZPXJG783fUr/z6IaAZyes=",
|
||||||
|
|
Loading…
Reference in a new issue