MCPcopy
hub / github.com/prometheus/pushgateway / LastPushSuccess

Method LastPushSuccess

storage/interface.go:135–145  ·  view source on GitHub ↗

LastPushSuccess returns false if the automatically added metric for the timestamp of the last failed push has a value larger than the value of the automatically added metric for the timestamp of the last successful push. In all other cases, it returns true (including the case that one or both of tho

()

Source from the content-addressed store, hash-verified

133// all other cases, it returns true (including the case that one or both of
134// those metrics are missing for some reason.)
135func (mg MetricGroup) LastPushSuccess() bool {
136 fail := mg.Metrics[pushFailedMetricName].GobbableMetricFamily
137 if fail == nil {
138 return true
139 }
140 success := mg.Metrics[pushMetricName].GobbableMetricFamily
141 if success == nil {
142 return true
143 }
144 return (*dto.MetricFamily)(fail).GetMetric()[0].GetGauge().GetValue() <= (*dto.MetricFamily)(success).GetMetric()[0].GetGauge().GetValue()
145}
146
147// NameToTimestampedMetricFamilyMap is the second level of the metric store,
148// keyed by metric name.

Callers 1

metricsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected