mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-07 10:17:51 +00:00
vendor: revendor
This commit is contained in:
parent
269295a414
commit
9f0440be0f
669 changed files with 58447 additions and 20021 deletions
8
vendor/k8s.io/component-base/metrics/processstarttime.go
generated
vendored
8
vendor/k8s.io/component-base/metrics/processstarttime.go
generated
vendored
|
|
@ -43,6 +43,12 @@ func RegisterProcessStartTime(registrationFunc func(Registerable) error) error {
|
|||
klog.Errorf("Could not get process start time, %v", err)
|
||||
start = float64(time.Now().Unix())
|
||||
}
|
||||
// processStartTime is a lazy metric which only get initialized after registered.
|
||||
// so we have to explicitly create it before setting the label value. Otherwise
|
||||
// it is a noop.
|
||||
if !processStartTime.IsCreated() {
|
||||
processStartTime.initializeMetric()
|
||||
}
|
||||
processStartTime.WithLabelValues().Set(start)
|
||||
return registrationFunc(processStartTime)
|
||||
}
|
||||
|
|
@ -54,7 +60,7 @@ func getProcessStart() (float64, error) {
|
|||
return 0, err
|
||||
}
|
||||
|
||||
if stat, err := p.NewStat(); err == nil {
|
||||
if stat, err := p.Stat(); err == nil {
|
||||
return stat.StartTime()
|
||||
}
|
||||
return 0, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue