(transaction *model.Transaction)
| 235 | } |
| 236 | |
| 237 | func (q *Queue) transactionQueueName(transaction *model.Transaction) string { |
| 238 | if q.config.Queue.EnableHotLane && transaction != nil && transaction.MetaData != nil { |
| 239 | if hotpairs.QueueLaneFromMetadata(transaction.MetaData) == hotpairs.LaneHot { |
| 240 | metrics.HotpairsLaneRoutedTotal.Add(context.Background(), 1, |
| 241 | otelmetric.WithAttributes(attribute.String("lane", "hot")), |
| 242 | ) |
| 243 | return q.config.Queue.HotQueueName |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | metrics.HotpairsLaneRoutedTotal.Add(context.Background(), 1, |
| 248 | otelmetric.WithAttributes(attribute.String("lane", "normal")), |
| 249 | ) |
| 250 | queueIndex := hashBalanceID(transaction.Source) % q.config.Queue.NumberOfQueues |
| 251 | return fmt.Sprintf("%s_%d", q.config.Queue.TransactionQueue, queueIndex+1) |
| 252 | } |
| 253 | |
| 254 | // hashBalanceID returns a consistent hash value for a string balance ID. |
| 255 | // |
no test coverage detected