| 375 | } |
| 376 | |
| 377 | func (s *queryRangeSharder) jobSize(expr *traceql.RootExpr, allowUnsafe bool) int { |
| 378 | // If we have a query hint then use it |
| 379 | if v, ok := expr.Hints.GetInt(traceql.HintJobSize, allowUnsafe); ok && v > 0 { |
| 380 | return v |
| 381 | } |
| 382 | |
| 383 | // Else use configured value. |
| 384 | size := s.cfg.TargetBytesPerRequest |
| 385 | |
| 386 | return size |
| 387 | } |
| 388 | |
| 389 | // exemplarsForBlock calculates exemplars for a single block based on its proportional duration. |
| 390 | // Example: if a block is 90s out of 100s total, with limit=100, it gets 90*1.2=108 exemplars. |