1534
func (s *ContextImpl) ioSemaphoreAcquire(
1535
ctx context.Context,
1537
>
priority := locks.PriorityHigh
1538
>
callerInfo := headers.GetCallerInfo(ctx)
1539
>
if callerInfo.CallerType == headers.CallerTypePreemptable {
1540
priority = locks.PriorityLow
1541
}
1542
1543
>
handler := s.metricsHandler.WithTags(metrics.OperationTag(metrics.ShardInfoScope), metrics.PriorityTag(priority))
context_impl.go
1544
>
metrics.SemaphoreRequests.With(handler).Record(1)
1545
>
startTime := time.Now().UTC()
1546
>
defer func() {
1547
>
metrics.SemaphoreLatency.With(handler).Record(time.Since(startTime))
1548
>
if retErr != nil {
1549
metrics.SemaphoreFailures.With(handler).Record(1)
1550
}
1551
}()
1552
1554
}
1555