MCPcopy
hub / github.com/grafana/dskit / readOnlyInstancesAndOldestReadOnlyUpdatedTimestamp

Method readOnlyInstancesAndOldestReadOnlyUpdatedTimestamp

ring/model.go:607–628  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

605}
606
607func (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
630type CompareResult int
631

Callers 1

setRingStateFromDescMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected