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
()
| 133 | // all other cases, it returns true (including the case that one or both of |
| 134 | // those metrics are missing for some reason.) |
| 135 | func (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. |