()
| 605 | } |
| 606 | |
| 607 | func (d *Desc) readOnlyInstancesAndOldestReadOnlyUpdatedTimestamp() (int, int64) { |
| 608 | readOnlyInstances := 0 |
| 609 | oldestReadOnlyUpdatedTimestamp := int64(0) |
| 610 | first := true |
| 611 | |
| 612 | if d != nil { |
| 613 | for _, ingester := range d.Ingesters { |
| 614 | if !ingester.ReadOnly { |
| 615 | continue |
| 616 | } |
| 617 | |
| 618 | readOnlyInstances++ |
| 619 | if first { |
| 620 | oldestReadOnlyUpdatedTimestamp = ingester.ReadOnlyUpdatedTimestamp |
| 621 | } else { |
| 622 | oldestReadOnlyUpdatedTimestamp = min(oldestReadOnlyUpdatedTimestamp, ingester.ReadOnlyUpdatedTimestamp) |
| 623 | } |
| 624 | first = false |
| 625 | } |
| 626 | } |
| 627 | return readOnlyInstances, oldestReadOnlyUpdatedTimestamp |
| 628 | } |
| 629 | |
| 630 | type CompareResult int |
| 631 |
no outgoing calls
no test coverage detected