getOldestUnshippedBlockMetric returns the unix timestamp of the oldest unshipped block or 0 if all blocks have been shipped.
()
| 3133 | // getOldestUnshippedBlockMetric returns the unix timestamp of the oldest unshipped block or |
| 3134 | // 0 if all blocks have been shipped. |
| 3135 | func (i *Ingester) getOldestUnshippedBlockMetric() float64 { |
| 3136 | i.stoppedMtx.RLock() |
| 3137 | defer i.stoppedMtx.RUnlock() |
| 3138 | |
| 3139 | oldest := uint64(0) |
| 3140 | for _, db := range i.TSDBState.dbs { |
| 3141 | if ts := db.getOldestUnshippedBlockTime(); oldest == 0 || ts < oldest { |
| 3142 | oldest = ts |
| 3143 | } |
| 3144 | } |
| 3145 | |
| 3146 | return float64(oldest / 1000) |
| 3147 | } |
| 3148 | |
| 3149 | func (i *Ingester) shipBlocksLoop(ctx context.Context) error { |
| 3150 | // We add a slight jitter to make sure that if the head compaction interval and ship interval are set to the same |
nothing calls this directly
no test coverage detected