329
}
330
}
331
>
metrics.QueueReaderCountHistogram.With(p.metricsHandler).Record(int64(len(readerScopes)))
queue_base.go
332
>
metrics.QueueSliceCountHistogram.With(p.metricsHandler).Record(int64(p.monitor.GetTotalSliceCount()))
333
>
metrics.PendingTasksCounter.With(p.metricsHandler).Record(int64(p.monitor.GetTotalPendingTaskCount()))
334
>
335
>
// NOTE: Must range-complete task first.
336
>
// Otherwise, if state is updated first, later deletion fails and the shard gets reloaded.
337
>
// Some tasks will never be deleted.
338
>
//
339
>
// Emit metric before the deletion watermark comparison so we have the emit even if there's no task
340
>
// for the queue.
341
>
metrics.TaskBatchCompleteCounter.With(p.metricsHandler).Record(1)
342
>
if newExclusiveDeletionHighWatermark.CompareTo(p.exclusiveDeletionHighWatermark) > 0 ||
343
>
(p.updateShardRangeID() && newExclusiveDeletionHighWatermark.CompareTo(tasks.MinimumKey) > 0) {
344
// When shard rangeID is updated, perform range completion again in case the underlying persistence implementation
345
// serves traffic based on the persisted shardInfo.