MCPcopy Create free account
hub / github.com/cortexproject/cortex / getOldestUnshippedBlockMetric

Method getOldestUnshippedBlockMetric

pkg/ingester/ingester.go:3135–3147  ·  view source on GitHub ↗

getOldestUnshippedBlockMetric returns the unix timestamp of the oldest unshipped block or 0 if all blocks have been shipped.

()

Source from the content-addressed store, hash-verified

3133// getOldestUnshippedBlockMetric returns the unix timestamp of the oldest unshipped block or
3134// 0 if all blocks have been shipped.
3135func (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
3149func (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

Callers

nothing calls this directly

Implementers 1

Ingesterpkg/ingester/ingester.go

Calls 1

Tested by

no test coverage detected