readOnlyInstanceCount returns the number of read only instances in the ring.
()
| 1532 | |
| 1533 | // readOnlyInstanceCount returns the number of read only instances in the ring. |
| 1534 | func (r *Ring) readOnlyInstanceCount() int { |
| 1535 | r.mtx.RLock() |
| 1536 | c := 0 |
| 1537 | for _, i := range r.ringDesc.Ingesters { |
| 1538 | if i.ReadOnly { |
| 1539 | c++ |
| 1540 | } |
| 1541 | } |
| 1542 | r.mtx.RUnlock() |
| 1543 | return c |
| 1544 | } |
| 1545 | |
| 1546 | // Operation describes which instances can be included in the replica set, based on their state. |
| 1547 | // |
no outgoing calls